qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [RFC PATCH 0/4] Configurable PCI device addresses
Date: Thu, 18 Jun 2009 15:14:06 +0200	[thread overview]
Message-ID: <cover.1245324581.git.armbru@redhat.com> (raw)

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

             reply	other threads:[~2009-06-18 13:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18 13:14 Markus Armbruster [this message]
2009-06-18 13:14 ` [Qemu-devel] [PATCH 1/4] Fix do_pci_register_device() to reject devfn already in use Markus Armbruster
2009-06-18 13:14 ` [Qemu-devel] [PATCH 2/4] Support addr=... in option argument of -net nic Markus Armbruster
2009-06-18 13:14 ` [Qemu-devel] [PATCH 3/4] Make first argument of monitor command pci_add work Markus Armbruster
2009-06-18 13:14 ` [Qemu-devel] [PATCH 4/4] Support addr=... in option argument of -drive if=virtio Markus Armbruster
2009-06-18 14:18 ` [Qemu-devel] [RFC PATCH 0/4] Configurable PCI device addresses Richard W.M. Jones
2009-06-18 14:25 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1245324581.git.armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).