[PATCH 2/2] qemu: do not drop implicit controllers with non-implicit attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jtomko@xxxxxxxxxx>
Reported-by: Joseph Richard <Joseph.Richard@xxxxxxxxxxxxx>
---
 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 4aaf617da..580e0f830 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++;
-- 
2.13.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux