diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 957989e8483c7d8edb5a7a2621ad9ffb501d6b3b..04636e8694739253b304343611ae69afc96f8c41 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15716,7 +15716,6 @@ virDomainVideoDefaultType(const virDomainDef *def) { switch ((virDomainVirtType)def->virtType) { case VIR_DOMAIN_VIRT_TEST: - case VIR_DOMAIN_VIRT_XEN: if (def->os.type == VIR_DOMAIN_OSTYPE_XEN || def->os.type == VIR_DOMAIN_OSTYPE_LINUX) return VIR_DOMAIN_VIDEO_TYPE_XEN; @@ -15737,6 +15736,7 @@ virDomainVideoDefaultType(const virDomainDef *def) return VIR_DOMAIN_VIDEO_TYPE_VGA; else return VIR_DOMAIN_VIDEO_TYPE_PARALLELS; + case VIR_DOMAIN_VIRT_XEN: case VIR_DOMAIN_VIRT_BHYVE: case VIR_DOMAIN_VIRT_QEMU: case VIR_DOMAIN_VIRT_KQEMU: diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index e3da9f777d0e6eb629f863bfbd4a07a0d5db08ed..cc53a765e1749f4746e194c6c9a60f3f7dbcd9dd 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -315,31 +315,43 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, pcisrc->backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN; } - if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && def->os.type == VIR_DOMAIN_OSTYPE_HVM) { - int dm_type = libxlDomainGetEmulatorType(def); - - switch (dev->data.video->type) { - case VIR_DOMAIN_VIDEO_TYPE_VGA: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - if (dev->data.video->vram == 0) { - if (dm_type == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) - dev->data.video->vram = 16 * 1024; - else - dev->data.video->vram = 8 * 1024; - } - break; - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - if (dev->data.video->vram == 0) { - if (dm_type == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) - dev->data.video->vram = 8 * 1024; - else - dev->data.video->vram = 4 * 1024; + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + if (def->os.type == VIR_DOMAIN_OSTYPE_XEN || + def->os.type == VIR_DOMAIN_OSTYPE_LINUX) + dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_XEN; + else if (ARCH_IS_PPC64(def->os.arch)) + dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_VGA; + else + dev->data.video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS; + } + + if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) { + int dm_type = libxlDomainGetEmulatorType(def); + + switch (dev->data.video->type) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_XEN: + if (dev->data.video->vram == 0) { + if (dm_type == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) + dev->data.video->vram = 16 * 1024; + else + dev->data.video->vram = 8 * 1024; + } + break; + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + if (dev->data.video->vram == 0) { + if (dm_type == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) + dev->data.video->vram = 8 * 1024; + else + dev->data.video->vram = 4 * 1024; + } + break; + case VIR_DOMAIN_VIDEO_TYPE_QXL: + if (dev->data.video->vram == 0) + dev->data.video->vram = 128 * 1024; + break; } - break; - case VIR_DOMAIN_VIDEO_TYPE_QXL: - if (dev->data.video->vram == 0) - dev->data.video->vram = 128 * 1024; - break; } }