qemu: Re-reserve all PCI addresses on libvirtd restart

When reconnecting to existing VMs, we re-reserved only those PCI
addresses which were explicitly mentioned in domain XML. Since some
addresses are always reserved (e.g., 0:0:0 and 0:0:1), we need to handle
those too.

Also all this should only be done if device flag is supported by qemu.
This commit is contained in:
Jiri Denemark 2010-08-13 16:16:19 +02:00
parent 8e3eeb4e1d
commit 4f86613ba1

View File

@ -1464,11 +1464,13 @@ qemuReconnectDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaq
if (qemudExtractVersionInfo(obj->def->emulator,
NULL,
&qemuCmdFlags) >= 0 &&
(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE))
(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)) {
priv->persistentAddrs = 1;
if (!(priv->pciaddrs = qemuDomainPCIAddressSetCreate(obj->def)))
if (!(priv->pciaddrs = qemuDomainPCIAddressSetCreate(obj->def)) ||
qemuAssignDevicePCISlots(obj->def, priv->pciaddrs) < 0)
goto error;
}
if (driver->securityDriver &&
driver->securityDriver->domainReserveSecurityLabel &&