Ian Campbell
2011-Dec-09 12:02 UTC
[PATCH 1 of 2] libxl: fix cold plugged PCI devices with stubdomains
# HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1323432076 0 # Node ID 9c1b223e152eaaa3861f9b6132590de0b4f6cb7e # Parent d8c390192ad1147d7202cf04be090478f1810a5d libxl: fix cold plugged PCI devices with stubdomains Since 23565:72eafe80ebc1 the xenstore entries for the stubdomain''s PCI were never created and therefore the stubdom ends up waiting forever for the devices which it has been asked to insert to show up. Since the stubdomain is already running when we call the libxl_device_pci_add loop in do_domain_create we should treat it as if "starting == 0". Signed-off-by: Ian Campbell <ian.campbell@citrix.com> diff -r d8c390192ad1 -r 9c1b223e152e tools/libxl/libxl_pci.c --- a/tools/libxl/libxl_pci.c Thu Dec 08 17:43:29 2011 +0000 +++ b/tools/libxl/libxl_pci.c Fri Dec 09 12:01:16 2011 +0000 @@ -819,7 +819,8 @@ int libxl__device_pci_add(libxl__gc *gc, stubdomid = libxl_get_stubdom_id(ctx, domid); if (stubdomid != 0) { libxl_device_pci pcidev_s = *pcidev; - rc = do_pci_add(gc, stubdomid, &pcidev_s, starting); + /* stubdomain is always running by now, even at create time */ + rc = do_pci_add(gc, stubdomid, &pcidev_s, 0); if ( rc ) goto out; }
Stefano Stabellini
2011-Dec-09 14:46 UTC
Re: [PATCH 1 of 2] libxl: fix cold plugged PCI devices with stubdomains
On Fri, 9 Dec 2011, Ian Campbell wrote:> # HG changeset patch > # User Ian Campbell <ian.campbell@citrix.com> > # Date 1323432076 0 > # Node ID 9c1b223e152eaaa3861f9b6132590de0b4f6cb7e > # Parent d8c390192ad1147d7202cf04be090478f1810a5d > libxl: fix cold plugged PCI devices with stubdomains > > Since 23565:72eafe80ebc1 the xenstore entries for the stubdomain''s PCI were > never created and therefore the stubdom ends up waiting forever for the devices > which it has been asked to insert to show up. > > Since the stubdomain is already running when we call the libxl_device_pci_add > loop in do_domain_create we should treat it as if "starting == 0". > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>Acked> diff -r d8c390192ad1 -r 9c1b223e152e tools/libxl/libxl_pci.c > --- a/tools/libxl/libxl_pci.c Thu Dec 08 17:43:29 2011 +0000 > +++ b/tools/libxl/libxl_pci.c Fri Dec 09 12:01:16 2011 +0000 > @@ -819,7 +819,8 @@ int libxl__device_pci_add(libxl__gc *gc, > stubdomid = libxl_get_stubdom_id(ctx, domid); > if (stubdomid != 0) { > libxl_device_pci pcidev_s = *pcidev; > - rc = do_pci_add(gc, stubdomid, &pcidev_s, starting); > + /* stubdomain is always running by now, even at create time */ > + rc = do_pci_add(gc, stubdomid, &pcidev_s, 0); > if ( rc ) > goto out; > } > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >
Ian Jackson
2011-Dec-09 16:57 UTC
Re: [PATCH 1 of 2] libxl: fix cold plugged PCI devices with stubdomains
Ian Campbell writes ("[PATCH 1 of 2] libxl: fix cold plugged PCI devices with stubdomains"):> libxl: fix cold plugged PCI devices with stubdomains > > Since 23565:72eafe80ebc1 the xenstore entries for the stubdomain''s > PCI were never created and therefore the stubdom ends up waiting > forever for the devices which it has been asked to insert to show > up. > > Since the stubdomain is already running when we call the libxl_device_pci_add > loop in do_domain_create we should treat it as if "starting == 0".That sounds plausible. Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Ian.