mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
Add newDomain parameter to qemuDomainAssignAddresses
Pass 'true' if we are not dealing with a migration.
This commit is contained in:
parent
b3ee621e94
commit
8b04ce598d
@ -2436,12 +2436,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;
|
||||
|
@ -1628,7 +1628,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;
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user