提交 767f9e14 编写于 作者: E Erik Skultety

qemu: validate: Enforce compile time switch type checking for videos

There wasn't an explicit type case to the video type enum in
qemuDomainDeviceDefValidateVideo, _TYPE_GOP was also missing from the
switch.
Signed-off-by: NErik Skultety <eskultet@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 75aa179a
...@@ -1453,7 +1453,7 @@ struct _virDomainVideoDriverDef { ...@@ -1453,7 +1453,7 @@ struct _virDomainVideoDriverDef {
}; };
struct _virDomainVideoDef { struct _virDomainVideoDef {
int type; int type; /* enum virDomainVideoType */
unsigned int ram; /* kibibytes (multiples of 1024) */ unsigned int ram; /* kibibytes (multiples of 1024) */
unsigned int vram; /* kibibytes (multiples of 1024) */ unsigned int vram; /* kibibytes (multiples of 1024) */
unsigned int vram64; /* kibibytes (multiples of 1024) */ unsigned int vram64; /* kibibytes (multiples of 1024) */
......
...@@ -4470,10 +4470,11 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev, ...@@ -4470,10 +4470,11 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev,
static int static int
qemuDomainDeviceDefValidateVideo(const virDomainVideoDef *video) qemuDomainDeviceDefValidateVideo(const virDomainVideoDef *video)
{ {
switch (video->type) { switch ((virDomainVideoType) video->type) {
case VIR_DOMAIN_VIDEO_TYPE_XEN: case VIR_DOMAIN_VIDEO_TYPE_XEN:
case VIR_DOMAIN_VIDEO_TYPE_VBOX: case VIR_DOMAIN_VIDEO_TYPE_VBOX:
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
case VIR_DOMAIN_VIDEO_TYPE_GOP:
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("video type '%s' is not supported with QEMU"), _("video type '%s' is not supported with QEMU"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册