mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +00:00
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: Rafael Fonseca <r4f4rfs@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
38c2b707c1
commit
0b9d2287ed
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user