qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [6609] Parse full PCI device addresses (Markus Armbrust


From: Marcelo Tosatti
Subject: Re: [Qemu-devel] [6609] Parse full PCI device addresses (Markus Armbruster)
Date: Thu, 12 Feb 2009 13:56:05 -0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Feb 12, 2009 at 03:39:26PM +0000, Paul Brook wrote:
> > This code parses full PCI device addresses.  It then rejects domains
> > other than zero, because these are not supported in QEMU.
> >...
> > + * Parse [[<domain>:]<bus>:]<slot>, return -1 on error
> > + */
> > +static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
> > unsigned *slotp) +{
> 
> If we're rejecting nonzero domains then having the parse routine return a 
> domain value seems wrong. It's just going to make it harder to verify correct 
> operation when domains are implemented.

+    /* Note: QEMU doesn't implement domains other than 0 */
+    if (dom != 0 || pci_find_bus(bus) == NULL) {
+       fprintf(stderr, "PCI device address %s not supported", addr);
+       return -1;
+    }

+    if (!strcmp(devaddr, "auto")) {
+        *domp = *busp = 0;
+        *slotp = -1;
+        /* want to support dom/bus auto-assign at some point */
+        return 0;
+    }

We return domain 0. I considered domain 0 as implicit at the moment, is
that wrong?

I can't see where you're getting at.




reply via email to

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