WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH] xend: fix options for assigned pci

On Mon, Jan 11, 2010 at 03:24:59PM +0800, Qing He wrote:
> On Mon, 2010-01-11 at 15:16 +0800, Simon Horman wrote:
> > > @@ -328,7 +332,7 @@
> > >      template['domain'] = "0x%04x" % domain
> > >      template['bus']    = "0x%02x" % int(pci_dev_info['bus'], 16)
> > >      template['slot']   = "0x%02x" % int(pci_dev_info['slot'], 16)
> > > -    template['key']    = pci_dev_str
> > > +    template['key']    = pci_dev_str.split(',')[0]
> > 
> > Splitting on a comma won't work as desired here, as the function
> > portion of multi-function devices may include comas.
> > 
> > Leaving the key as pci_dev_str, is probably ok. Otherwise I suggest
> > constructing the key from template['domain'], template['bus'],
> > template['slot'], pci_dev_infom['func'] and conditionally
> > pci_dev_infom['vdevfn'].
> 
> Thank you for commenting
> In fact, changing the key here doesn't explictly impact the option part
> I'm trying to fix, because ioemu doesn't seem to use backend when creating
> devices. I just changed it for consistency since I found that options
> were also attached in key using comma, but I failed to notice its
> usage as a separator of multi-function devices.
> 
> But if comma is also used for multi-function device, can you show
> me how it looks like? Is there any conflicts between it and the
> pci options?

I don't think there are any conflicts, because the function
can't include '[a-z]' and all options start with '[a-z]'

I documented the syntax on http://wiki.xensource.com/xenwiki/BDFNotation

Basically where the function used to go, it may optionally be
a comma-delimited list of:

* Function unit
* A range of function numbers, denoted by:
  + The first function unit
  + A hyphen (-)
  + The last function unit
* An asterisk (*), used to denote all physical functions that are present in
  the device

Where a function unit comprises of:

* Function number and optionally;
* An equals sign and;
* A virtual function number to use

> > IIRC, it doesn't really matter what the key is, as long as it
> > is unique for a device. Which is why I think that leaving it
> > as pci_dev_str should be ok.
> 
> Changing it back doesn't affect the pci options functionally, AFAIK.

Excellent. Lets do that.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>