]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Detect PCI addresses at QEMU startup
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 9 Dec 2009 21:59:04 +0000 (21:59 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 18 Jan 2010 12:44:50 +0000 (12:44 +0000)
commit989051a85e637e319911a67fc5759b6418737953
tree10a7840a8605bfe1b8727d412c07e9b8c35c90b0
parent3a6bf1bb78e8c7140462db240b66109f8c16345d
Detect PCI addresses at QEMU startup

Hotunplug of devices requires that we know their PCI address. Even
hotplug of SCSI drives, required that we know the PCI address of
the SCSI controller to attach the drive to. We can find this out
by running 'info pci' and then correlating the vendor/product IDs
with the devices we booted with.

Although this approach is somewhat fragile, it is the only viable
option with QEMU < 0.12, since there is no way for libvirto set
explicit PCI addresses when creating devices in the first place.
For QEMU > 0.12, this code will not be used.

* src/qemu/qemu_driver.c: Assign all dynamic PCI addresses on
  startup of QEMU VM, matching vendor/product IDs
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
  API for fetching PCI device address mapping
src/qemu/qemu_driver.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.h
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.h