[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 0/4] Configurable PCI device addresses

From: Markus Armbruster
Subject: [Qemu-devel] [RFC PATCH 0/4] Configurable PCI device addresses
Date: Thu, 18 Jun 2009 15:14:06 +0200

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

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(-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]