]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Retain disk PCI address across libvirtd restarts
authorMark McLoughlin <markmc@redhat.com>
Fri, 17 Jul 2009 21:08:33 +0000 (22:08 +0100)
committerMark McLoughlin <markmc@redhat.com>
Wed, 22 Jul 2009 10:34:05 +0000 (11:34 +0100)
commit0165410712e25fffa0585bf026762e3cdc623a9e
tree628d6f8a3ecd7620b260026b13ead6fb74522652
parentaa98871c777d0ac2fea206b323afbe69827a47cd
Retain disk PCI address across libvirtd restarts

When we hot-plug a disk device into a qemu guest, we need to retain its
PCI address so that it can be removed again later. Currently, we do
retain the slot number, but not across libvirtd restarts.

Add <state devaddr="xxxx:xx:xx"/> to the disk device XML config when the
VIR_DOMAIN_XML_INTERNAL_STATUS flag is used. We still don't parse the
domain and bus number, but the format allows us to do that in future.

* src/domain_conf.h: replace slotnum with pci_addr struct, add helper
  for testing whether the address is valid

* src/domain_conf.c: handle formatting and parsing the address

* src/qemu_driver.c: store the parsed slot number as a full PCI address,
  and use this address with the pci_del monitor command

* src/vbox/vbox_tmpl.c: we're debug printing slotnum here even though
  it can never be set, just delete it
src/domain_conf.c
src/domain_conf.h
src/qemu_driver.c
src/vbox/vbox_tmpl.c