
On Mon, Feb 01, 2010 at 06:39:36PM +0000, Daniel P. Berrange wrote:
PCI disk, disk controllers, net devices and host devices need to have PCI addresses assigned before they are hot-plugged
* src/qemu/qemu_conf.c: Add APIs for ensuring a device has an address and releasing unused addresses * src/qemu/qemu_driver.c: Ensure all devices have addresses when hotplugging. --- src/qemu/qemu_conf.c | 60 ++++++++++++++++++++++++++++++++++++++--------- src/qemu/qemu_conf.h | 11 +++++++- src/qemu/qemu_driver.c | 43 ++++++++++++++++++++++++++++++++-- 3 files changed, 97 insertions(+), 17 deletions(-) [...] cleanup: + if ((ret != 0) && + (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) && + (net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) && + qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &net->info) < 0) + VIR_WARN0("Unable to release PCI address on NIC"); +
Wondering to which extend (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) check shouldn't be handled down in allocation and releasing routines instead of before each invocation, but it's minor. ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/