提交 786bc251 编写于 作者: J Ján Tomko

qemu: assign addresses before aliases

The address assigning code might add new pci bridges.
We need them to have an alias when building the command line.

In real word usage, this is not a problem because all the code
paths already call qemuDomainAssignAddresses. However moving
this call lets us remove one extra call from qemuxml2argvtest.
上级 1922d2f1
...@@ -4998,6 +4998,19 @@ qemuProcessPrepareDomain(virConnectPtr conn, ...@@ -4998,6 +4998,19 @@ qemuProcessPrepareDomain(virConnectPtr conn,
} }
} }
/*
* Normally PCI addresses are assigned in the virDomainCreate
* or virDomainDefine methods. We might still need to assign
* some here to cope with the question of upgrades. Regardless
* we also need to populate the PCI address set cache for later
* use in hotplug
*/
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
VIR_DEBUG("Assigning domain PCI addresses");
if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
goto cleanup;
}
if (qemuAssignDeviceAliases(vm->def, priv->qemuCaps) < 0) if (qemuAssignDeviceAliases(vm->def, priv->qemuCaps) < 0)
goto cleanup; goto cleanup;
...@@ -5021,19 +5034,6 @@ qemuProcessPrepareDomain(virConnectPtr conn, ...@@ -5021,19 +5034,6 @@ qemuProcessPrepareDomain(virConnectPtr conn,
priv->monStart = 0; priv->monStart = 0;
priv->gotShutdown = false; priv->gotShutdown = false;
/*
* Normally PCI addresses are assigned in the virDomainCreate
* or virDomainDefine methods. We might still need to assign
* some here to cope with the question of upgrades. Regardless
* we also need to populate the PCI address set cache for later
* use in hotplug
*/
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
VIR_DEBUG("Assigning domain PCI addresses");
if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
goto cleanup;
}
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(nodeset); VIR_FREE(nodeset);
......
...@@ -311,12 +311,6 @@ static int testCompareXMLToArgvFiles(const char *xml, ...@@ -311,12 +311,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
virQEMUCapsFilterByMachineType(extraFlags, vm->def->os.machine); virQEMUCapsFilterByMachineType(extraFlags, vm->def->os.machine);
if (qemuDomainAssignAddresses(vm->def, extraFlags, NULL)) {
if (flags & FLAG_EXPECT_FAILURE)
goto ok;
goto out;
}
log = virtTestLogContentAndReset(); log = virtTestLogContentAndReset();
VIR_FREE(log); VIR_FREE(log);
virResetLastError(); virResetLastError();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册