You need to sign in or sign up before continuing.
提交 0b9d2287 编写于 作者: R Rafael Fonseca 提交者: Michal Privoznik

vbox: move video default logic to driver

The logic setting a device default should be in the post parse function
of individual driver code.
Signed-off-by: NRafael Fonseca <r4f4rfs@gmail.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 38c2b707
...@@ -15716,8 +15716,6 @@ virDomainVideoDefaultType(const virDomainDef *def) ...@@ -15716,8 +15716,6 @@ virDomainVideoDefaultType(const virDomainDef *def)
{ {
switch ((virDomainVirtType)def->virtType) { switch ((virDomainVirtType)def->virtType) {
case VIR_DOMAIN_VIRT_VBOX: case VIR_DOMAIN_VIRT_VBOX:
return VIR_DOMAIN_VIDEO_TYPE_VBOX;
case VIR_DOMAIN_VIRT_TEST: case VIR_DOMAIN_VIRT_TEST:
case VIR_DOMAIN_VIRT_VMWARE: case VIR_DOMAIN_VIRT_VMWARE:
case VIR_DOMAIN_VIRT_VZ: case VIR_DOMAIN_VIRT_VZ:
......
...@@ -62,9 +62,25 @@ static virMutex vbox_driver_lock = VIR_MUTEX_INITIALIZER; ...@@ -62,9 +62,25 @@ static virMutex vbox_driver_lock = VIR_MUTEX_INITIALIZER;
static vboxDriverPtr vbox_driver; static vboxDriverPtr vbox_driver;
static vboxDriverPtr vboxDriverObjNew(void); 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 = { static virDomainDefParserConfig vboxDomainDefParserConfig = {
.macPrefix = { 0x08, 0x00, 0x27 }, .macPrefix = { 0x08, 0x00, 0x27 },
.features = VIR_DOMAIN_DEF_FEATURE_NAME_SLASH, .features = VIR_DOMAIN_DEF_FEATURE_NAME_SLASH,
.devicesPostParseCallback = vboxDomainDevicesDefPostParse,
}; };
static virCapsPtr static virCapsPtr
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册