[libvirt] [PATCH 12/12] Detect PCI addresses at QEMU startup
markmc at redhat.com
Fri Dec 18 11:44:54 UTC 2009
This looks good, except we're encoding a lot more knowledge of how qemu
works than I'd like.
The plan we had to future proof this was that libvirt would assign an id
(using -device foo,id=bar) and 'info pci' would include the device id in
Once you have that, you no longer need to make assumptions about what
product:vendor is used for each device or what order addresses are
allocated. It's a simple addition to qemu and a simple addition to your
'info pci' parsing code, but I think we'd rest easier wrt. future
Random thought - how well does this patch work if e.g. you don't specify
a NIC model? I don't see where we hard-code the knowledge about what
model qemu uses by default ...
Also, it'd be good to have unit tests for this - inputs would be a
domain XML lacking addresses, the corresponding 'info pci' output and it
would check addresses against an expected resulting domain XML.
More information about the libvir-list