From a1745174e9e7bcab01db43688840b588018789ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Sun, 25 Mar 2018 20:54:07 +0200 Subject: [PATCH] qemu: do not drop implicit controllers with non-implicit attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If someone set a user alias or pcihole64 on an implicit controller, we need to format it to migrate the domain properly. Signed-off-by: Ján Tomko Reported-by: Joseph Richard --- src/qemu/qemu_domain.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 4aaf617dae..580e0f830d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6181,7 +6181,8 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, if (ARCH_IS_X86(def->os.arch) && qemuDomainIsI440FX(def) && usb && usb->idx == 0 && (usb->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT || - usb->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI)) { + usb->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI) && + !virDomainDeviceAliasIsUserAlias(usb->info.alias)) { VIR_DEBUG("Removing default USB controller from domain '%s'" " for migration compatibility", def->name); toremove++; @@ -6202,7 +6203,9 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, } if (pci && pci->idx == 0 && - pci->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { + pci->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT && + !virDomainDeviceAliasIsUserAlias(pci->info.alias) && + !pci->opts.pciopts.pcihole64) { VIR_DEBUG("Removing default pci-root from domain '%s'" " for migration compatibility", def->name); toremove++;