diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 53fd13e80f..665bb10b27 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15716,8 +15716,6 @@ virDomainVideoDefaultType(const virDomainDef *def) { switch ((virDomainVirtType)def->virtType) { case VIR_DOMAIN_VIRT_VBOX: - return VIR_DOMAIN_VIDEO_TYPE_VBOX; - case VIR_DOMAIN_VIRT_TEST: case VIR_DOMAIN_VIRT_VMWARE: case VIR_DOMAIN_VIRT_VZ: diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 618663952a..e98ae04ec0 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -62,9 +62,25 @@ static virMutex vbox_driver_lock = VIR_MUTEX_INITIALIZER; static vboxDriverPtr vbox_driver; static vboxDriverPtr vboxDriverObjNew(void); +static int +vboxDomainDevicesDefPostParse(virDomainDeviceDefPtr dev G_GNUC_UNUSED, + const virDomainDef *def G_GNUC_UNUSED, + unsigned int parseFlags G_GNUC_UNUSED, + void *opaque G_GNUC_UNUSED, + void *parseOpaque G_GNUC_UNUSED) +{ + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VBOX; + } + + return 0; +} + static virDomainDefParserConfig vboxDomainDefParserConfig = { .macPrefix = { 0x08, 0x00, 0x27 }, .features = VIR_DOMAIN_DEF_FEATURE_NAME_SLASH, + .devicesPostParseCallback = vboxDomainDevicesDefPostParse, }; static virCapsPtr