diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6dea670257..67555c9be3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15504,11 +15504,13 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt, } if (driver_name) { - if ((def->backend = virDomainVideoBackendTypeFromString(driver_name)) < 0) { + int backend; + if ((backend = virDomainVideoBackendTypeFromString(driver_name)) <= 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown video driver '%s'"), driver_name); goto error; } + def->backend = backend; } else { def->backend = VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cff33f6682..53bdee22fb 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1378,7 +1378,7 @@ struct _virDomainWatchdogDef { /* the backend driver used for virtio interfaces */ typedef enum { - VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT, + VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT = 0, VIR_DOMAIN_VIDEO_BACKEND_TYPE_QEMU, VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER,