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

Re: [Xen-devel] Re: [Xen-changelog] [xen-unstable] xend: hot-plug PCI devices at boot-time



On Tue, Jun 02, 2009 at 10:52:39PM +1000, Simon Horman wrote:
> On Tue, Jun 02, 2009 at 07:31:35PM +0800, Cui, Dexuan wrote:
> > Cui, Dexuan wrote:
> > > Simon Horman wrote:
> > >> On Tue, Jun 02, 2009 at 04:38:17PM +0800, Cui, Dexuan wrote:
> > >>> Simon Horman wrote:
> > >>>> On Tue, Jun 02, 2009 at 01:05:16PM +0800, Cui, Dexuan wrote:
> > >> 
> > >> [snip]
> > >> 
> > >>>>> BTW, there is another bug with guest hotplug:
> > >>>>> After I create a guest without assigning any device to it, I can
> > >>>>> 'xm pci-attach' a device into the guest, but "xm pci-list" doesn't
> > >>>>> show the vslot info. Looks this issue is originally introduced by
> > >>>>> c/s 19510. Can you and Masaki Kanno have a look?
> > >>>> 
> > >>>> Yes, of course, I will look into it.
> > >>>> 
> > >>>> Which revisions of xen-unstable.hg and qemu-xen-unstable.git are
> > >>>> you using?
> > >>> I'm using the latest xen c/s 19696 and ioemu
> > >>> 72f4654095e0ac1539749b628e98f5e1569c9801 plus applying your patch
> > >>> manually now and can still reproduce it.
> > >> 
> > >> Are you booting an HVM domain?
> > >> I am not able to see this problem with the config below
> > >> and running the following commands to attach a device:
> > >> 
> > >> $ xm pci-list debian
> > >> $ xm pci-attach debian 01:00.0
> > >> $ xm pci-list debian
> > >> domain bus  slot func
> > >> 0x0000 0x01 0x00 0x0
> > > Here, I think the VSLT is missing?
> > 
> > I expect it should be something like:
> > 
> > $ xm pci-list debian
> > VSlt domain bus  slot func
> > 0x04 0x0000 0x01 0x00 0x0
> 
> Sorry, my mistake. I see the problem now. I will investigate.

Hi Dexuan,

can you see if the following resolves the problem that you are seeing?

----------------------------------------------------------------------

xend: pass-through: record the vslot of first pass-through device

Make sure that if a vslot is assigned to the first pass-through device
it is recorded and subsequently used by xm and xend.

e.g.:
$ xm pci-list debian
$ xm pci-attach debian 01:00.0
$ xm pci-list debian
VSlt domain bus  slot func
0x04 0x0000 0x01 0x00 0x0

Without this change the output of the last command is:
domain bus  slot func
0x0000 0x01 0x00 0x0

Thanks to Dexuan Cui for pointing this out. It appears to
be a regression introduced in change-set 'xm, xend: Replace "vslt" with "vslot"'
(19510:5c69f98c348e) and thus present in the 3.4.0 release.

Cc: Dexuan Cui <dexuan.cui@xxxxxxxxx>,
Cc: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-unstable.hg.orig/tools/python/xen/xend/XendDomainInfo.py        
2009-06-03 01:01:01.000000000 +1000
+++ xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py     2009-06-03 
01:02:03.000000000 +1000
@@ -762,6 +762,13 @@ class XendDomainInfo:
                 raise VmError(("Cannot pass-through PCI function '%s'. " +
                                "Device model reported an error: %s") %
                               (bdf_str, vslot))
+
+            # A vslot has been assigned if the result isn't AUTO_PHP_SLOT
+            # and the request contained 'requested_vslot'.
+            # If assignment has occured, update new_dev accordingly.
+            if vslot_int != AUTO_PHP_SLOT and 'requested_vslot' in new_dev:
+                new_dev['vslot'] = vslot
+                del new_dev['requested_vslot']
         else:
             vslot = new_dev['requested_vslot']
 
@@ -880,7 +887,9 @@ class XendDomainInfo:
 
         # If pci platform does not exist, create and exit.
         if existing_dev_info is None:
-            self.device_create(dev_sxp)
+            new_dev_sxp = self.info.pci_convert_dict_to_sxp(
+                    dev_config['devs'][0], pci_state, pci_sub_state)
+            self.device_create(new_dev_sxp)
             return True
 
         if self.domid is not None:

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.