From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58971 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOGj3-0008Pm-GQ for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:57:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOGj1-0007v2-Rm for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:57:45 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:56474) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOGj1-0007ly-Ot for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:57:43 -0400 Received: by mail-iw0-f173.google.com with SMTP id 10so4582648iwn.4 for ; Mon, 14 Jun 2010 13:57:43 -0700 (PDT) Message-ID: <4C1697C9.6040009@codemonkey.ws> Date: Mon, 14 Jun 2010 15:57:45 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Clarify error message when a PCI slot is already in use (v2) References: <1276007065-30744-1-git-send-email-berrange@redhat.com> In-Reply-To: <1276007065-30744-1-git-send-email-berrange@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org On 06/08/2010 09:24 AM, Daniel P. Berrange wrote: > When mistakenly configuring two devices in the same PCI slot, > QEMU gives a not entirely obvious message about a 'devfn' being > in use: > > $ qemu -device rtl8139 -device virtio-balloon-pci,bus=pci.0,addr=0x3 > qemu-kvm: -device virtio-balloon-pci,bus=pci.0,addr=0x3: PCI: devfn 24 not available for virtio-balloon-pci, in use by rtl8139 > > The user does not configure 'devfn' numbers, they use slot+function. > Thus the error messages should be reported back to the user with that > same terminology rather than the internal QEMU terminology. This > patch makes it report: > > $ qemu -device rtl8139 -device virtio-balloon-pci,bus=pci.0,addr=0x3 > qemu: -device virtio-balloon-pci,bus=pci.0,addr=0x3.7: PCI: slot 3 function 0 not available for virtio-balloon-pci, in use by rtl8139 > > Signed-off-by: Daniel P. Berrange > Applied. Thanks. Regards, Anthony Liguori > --- > hw/pci.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index cbbd1dd..cd7ce8d 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -609,12 +609,12 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, > if (!bus->devices[devfn]) > goto found; > } > - error_report("PCI: no devfn available for %s, all in use", name); > + error_report("PCI: no slot/function available for %s, all in use", name); > return NULL; > found: ; > } else if (bus->devices[devfn]) { > - error_report("PCI: devfn %d not available for %s, in use by %s", > - devfn, name, bus->devices[devfn]->name); > + error_report("PCI: slot %d function %d not available for %s, in use by %s", > + PCI_SLOT(devfn), PCI_FUNC(devfn), name, bus->devices[devfn]->name); > return NULL; > } > pci_dev->bus = bus; >