Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
16dfe015
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
16dfe015
编写于
4月 14, 2016
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
event-test: warn on unhandled enum values
Avoid forgetting to add the correct fields to the switches in event-test.
上级
ab48005f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
59 addition
and
0 deletion
+59
-0
examples/Makefile.am
examples/Makefile.am
+5
-0
examples/object-events/event-test.c
examples/object-events/event-test.c
+54
-0
未找到文件。
examples/Makefile.am
浏览文件 @
16dfe015
...
...
@@ -48,7 +48,12 @@ dommigrate_dommigrate_SOURCES = dommigrate/dommigrate.c
domsuspend_suspend_SOURCES
=
domsuspend/suspend.c
domtop_domtop_SOURCES
=
domtop/domtop.c
hellolibvirt_hellolibvirt_SOURCES
=
hellolibvirt/hellolibvirt.c
object_events_event_test_CFLAGS
=
\
$(WARN_CFLAGS)
\
$(NULL)
object_events_event_test_SOURCES
=
object-events/event-test.c
openauth_openauth_SOURCES
=
openauth/openauth.c
rename_rename_SOURCES
=
rename/rename.c
...
...
examples/object-events/event-test.c
浏览文件 @
16dfe015
...
...
@@ -6,6 +6,8 @@
#include <signal.h>
#include <inttypes.h>
#define VIR_ENUM_SENTINELS
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
...
...
@@ -41,6 +43,9 @@ connectClose(virConnectPtr conn ATTRIBUTE_UNUSED,
case
VIR_CONNECT_CLOSE_REASON_CLIENT
:
fprintf
(
stderr
,
"Connection closed due to client request
\n
"
);
return
;
case
VIR_CONNECT_CLOSE_REASON_LAST
:
break
;
};
fprintf
(
stderr
,
"Connection closed due to unknown reason
\n
"
);
...
...
@@ -77,6 +82,9 @@ eventToString(int event)
case
VIR_DOMAIN_EVENT_CRASHED
:
return
"Crashed"
;
case
VIR_DOMAIN_EVENT_LAST
:
break
;
}
return
"unknown"
;
...
...
@@ -101,6 +109,9 @@ eventDetailToString(int event,
case
VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT
:
return
"Snapshot"
;
case
VIR_DOMAIN_EVENT_DEFINED_LAST
:
break
;
}
break
;
...
...
@@ -111,6 +122,9 @@ eventDetailToString(int event,
case
VIR_DOMAIN_EVENT_UNDEFINED_RENAMED
:
return
"Renamed"
;
case
VIR_DOMAIN_EVENT_UNDEFINED_LAST
:
break
;
}
break
;
...
...
@@ -130,6 +144,9 @@ eventDetailToString(int event,
case
VIR_DOMAIN_EVENT_STARTED_WAKEUP
:
return
"Event wakeup"
;
case
VIR_DOMAIN_EVENT_STARTED_LAST
:
break
;
}
break
;
...
...
@@ -161,6 +178,9 @@ eventDetailToString(int event,
case
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED
:
return
"Post-copy Error"
;
case
VIR_DOMAIN_EVENT_SUSPENDED_LAST
:
break
;
}
break
;
...
...
@@ -177,6 +197,9 @@ eventDetailToString(int event,
case
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY
:
return
"Post-copy"
;
case
VIR_DOMAIN_EVENT_RESUMED_LAST
:
break
;
}
break
;
...
...
@@ -202,6 +225,9 @@ eventDetailToString(int event,
case
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT
:
return
"Snapshot"
;
case
VIR_DOMAIN_EVENT_STOPPED_LAST
:
break
;
}
break
;
...
...
@@ -210,6 +236,8 @@ eventDetailToString(int event,
case
VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED
:
return
"Finished"
;
case
VIR_DOMAIN_EVENT_SHUTDOWN_LAST
:
break
;
}
break
;
...
...
@@ -220,6 +248,9 @@ eventDetailToString(int event,
case
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK
:
return
"Disk"
;
case
VIR_DOMAIN_EVENT_PMSUSPENDED_LAST
:
break
;
}
break
;
...
...
@@ -227,8 +258,14 @@ eventDetailToString(int event,
switch
((
virDomainEventCrashedDetailType
)
detail
)
{
case
VIR_DOMAIN_EVENT_CRASHED_PANICKED
:
return
"Panicked"
;
case
VIR_DOMAIN_EVENT_CRASHED_LAST
:
break
;
}
break
;
case
VIR_DOMAIN_EVENT_LAST
:
break
;
}
return
"unknown"
;
...
...
@@ -251,6 +288,8 @@ networkEventToString(int event)
case
VIR_NETWORK_EVENT_STOPPED
:
return
"Stopped"
;
case
VIR_NETWORK_EVENT_LAST
:
break
;
}
return
"unknown"
;
...
...
@@ -266,6 +305,9 @@ guestAgentLifecycleEventStateToString(int event)
case
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED
:
return
"Connected"
;
case
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_LAST
:
break
;
}
return
"unknown"
;
...
...
@@ -284,6 +326,9 @@ guestAgentLifecycleEventReasonToString(int event)
case
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL
:
return
"Channel event"
;
case
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_LAST
:
break
;
}
return
"unknown"
;
...
...
@@ -398,6 +443,9 @@ graphicsPhaseToStr(int phase)
case
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT
:
return
"disconnected"
;
case
VIR_DOMAIN_EVENT_GRAPHICS_LAST
:
break
;
}
return
"unknown"
;
...
...
@@ -457,6 +505,9 @@ diskChangeReasonToStr(int reason)
case
VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START
:
return
"disk dropped due to startupPolicy"
;
case
VIR_DOMAIN_EVENT_DISK_CHANGE_LAST
:
break
;
}
return
"unknown"
;
...
...
@@ -488,6 +539,9 @@ trayChangeReasonToStr(int reason)
case
VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE
:
return
"close"
;
case
VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST
:
break
;
}
return
"unknown"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录