[PATCH 09/17] Add newDomain parameter to qemuDomainAssignAddresses

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

 



Pass 'true' if we are not dealing with a migration.
---
 src/qemu/qemu_domain.c         | 3 ++-
 src/qemu/qemu_domain_address.c | 3 ++-
 src/qemu/qemu_domain_address.h | 3 ++-
 src/qemu/qemu_process.c        | 7 ++++---
 tests/qemuhotplugtest.c        | 2 +-
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1eb5644..a4c6606 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2426,12 +2426,13 @@ qemuDomainDefAssignAddresses(virDomainDef *def,
     virQEMUDriverPtr driver = opaque;
     virQEMUCapsPtr qemuCaps = NULL;
     int ret = -1;
+    bool newDomain = parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
 
     if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
                                             def->emulator)))
         goto cleanup;
 
-    if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
+    if (qemuDomainAssignAddresses(def, qemuCaps, NULL, newDomain) < 0)
         goto cleanup;
 
     ret = 0;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index ca3adc0..1382a53 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -1622,7 +1622,8 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
 int
 qemuDomainAssignAddresses(virDomainDefPtr def,
                           virQEMUCapsPtr qemuCaps,
-                          virDomainObjPtr obj)
+                          virDomainObjPtr obj,
+                          bool newDomain ATTRIBUTE_UNUSED)
 {
     if (qemuDomainAssignVirtioSerialAddresses(def, obj) < 0)
         return -1;
diff --git a/src/qemu/qemu_domain_address.h b/src/qemu/qemu_domain_address.h
index 50019b8..ee326d7 100644
--- a/src/qemu/qemu_domain_address.h
+++ b/src/qemu/qemu_domain_address.h
@@ -33,7 +33,8 @@ int qemuDomainSetSCSIControllerModel(const virDomainDef *def,
 
 int qemuDomainAssignAddresses(virDomainDefPtr def,
                               virQEMUCapsPtr qemuCaps,
-                              virDomainObjPtr obj)
+                              virDomainObjPtr obj,
+                              bool newDomain)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 
 void qemuDomainReleaseDeviceAddress(virDomainObjPtr vm,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 373e7a9..ab0be0c 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3291,7 +3291,7 @@ qemuProcessReconnect(void *opaque)
         goto cleanup;
     }
 
-    if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj)) < 0)
+    if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj, false)) < 0)
         goto error;
 
     /* if domain requests security driver we haven't loaded, report error, but
@@ -4878,7 +4878,8 @@ qemuProcessPrepareDomain(virConnectPtr conn,
      * use in hotplug
      */
     VIR_DEBUG("Assigning domain PCI addresses");
-    if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
+    if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm,
+                                   !!(flags & VIR_QEMU_PROCESS_START_NEW))) < 0)
         goto cleanup;
 
     if (qemuAssignDeviceAliases(vm->def, priv->qemuCaps) < 0)
@@ -6066,7 +6067,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
      * use in hotplug
      */
     VIR_DEBUG("Assigning domain PCI addresses");
-    if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
+    if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm, false)) < 0)
         goto error;
 
     if ((timestamp = virTimeStringNow()) == NULL)
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 13055ab..91bf331 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -86,7 +86,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
                                                VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto cleanup;
 
-    if (qemuDomainAssignAddresses((*vm)->def, priv->qemuCaps, *vm) < 0)
+    if (qemuDomainAssignAddresses((*vm)->def, priv->qemuCaps, *vm, true) < 0)
         goto cleanup;
 
     if (qemuAssignDeviceAliases((*vm)->def, priv->qemuCaps) < 0)
-- 
2.7.3

--
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]