RFC Configurable PCI device addresses
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest4 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | Fix do_pci_register_device() to reject devfn already in usehw/ | +2 | 0 replies | |
| 2/4 | Support addr=... in option argument of -net nichw/ hw/ hw/ +13 more | +75 | 0 replies | |
| 3/4 | Make first argument of monitor command pci_add workhw/ hw/ hw/ | +28 | 0 replies | |
| 4/4 | Support addr=... in option argument of -drive if=virtiohw/ hw/ hw/ +4 more | +35 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [RFC PATCH 0/4] Configurable PCI device addresses
I'm marking this patch series as RFC, because I'm not quite done testing. Please review.
Provide addr= in device option arguments for NICs (PCI only) and virtio-blk-pci. More devices to follow.
Command line options -net nic and -drive get a new parameter addr, which is interpreted by device code.
Because only virtio-blk-pci implements -drive parameter addr, -drive rejects it unless if=virtio.
Only PCI NICs implement -net nic parameter addr, others silently ignore it.
Monitor command pci_add already provides syntax to select the PCI address, but it doesn't actually work (see patch 3 for details). This patch series makes pci_add work without changing its syntax. addr= in the third argument is caught and rejected because the first argument already has a mandatory pci_addr=. See patches 2 and 4 for how that's done.
Aside: the pci_add syntax is ugly. It has two name=value,... arguments, and the first one only accepts the name pci_addr (all other names are silently ignored). Similar ugliness in pci_del and drive_add.
While testing this, I stumbled over a pre-existing pci_add problem: it uses ordinary device initialization code, which prints to stderr and exits on error. That's not approproate for monitor commands.
Example: "pci_add pci_addr=auto nic model=xxx" goes qemu_pci_hot_add_nic() -> pci_nic_init() -> qemu_check_nic_model_list() -> exit(). Not fixed.
Testing showed that PCI devices work in some slots, but not in others, regardless of this patch (to be reported separately). This patch makes the problem more visible, but it doesn't cause it.
Markus Armbruster (4):
Fix do_pci_register_device() to reject devfn already in use Support addr=... in option argument of -net nic Make first argument of monitor command pci_add work Support addr=... in option argument of -drive if=virtio
hw/mips_malta.c | 10 +++--- hw/pc.c | 7 +++- hw/pci-hotplug.c | 64 ++++++++++++++++++++++++++++------------------- hw/pci.c | 53 ++++++++++++++++++++++++++++----------- hw/pci.h | 6 ++-- hw/ppc440_bamboo.c | 6 +++- hw/ppc_newworld.c | 2 +- hw/ppc_oldworld.c | 2 +- hw/ppc_prep.c | 2 +- hw/ppce500_mpc8544ds.c | 6 +++- hw/r2d.c | 2 +- hw/realview.c | 2 +- hw/versatilepb.c | 2 +- net.c | 5 +++- net.h | 1 + qemu-options.hx | 10 +++++-- sysemu.h | 1 + vl.c | 14 +++++++++- 18 files changed, 129 insertions(+), 66 deletions(-)