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

Re: [Xen-devel] [PATCH 2 of 3] Check whether a PCI device is assignable

To: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2 of 3] Check whether a PCI device is assignable before assigning it do a domU
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Fri, 30 Jul 2010 16:21:16 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Fri, 30 Jul 2010 08:22:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <099e4eb3803a528eb5d1.1280346050@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <patchbomb.1280346048@xxxxxxxxxxxxxxxxxxxxxx> <099e4eb3803a528eb5d1.1280346050@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2010-07-28 at 20:40 +0100, Gianni Tedesco wrote:
>  int libxl_device_pci_shutdown(struct libxl_ctx *ctx, uint32_t domid)
>  {
>      libxl_device_pci *pcidevs;
> -    int num, i;
> +    int num, i, rc;
> 
> -    pcidevs = libxl_device_pci_list(ctx, domid, &num);
> +    rc = libxl_device_pci_list_assigned(ctx, &pcidevs, domid, &num);
> +    if ( rc )
> +        return rc;
>      for (i = 0; i < num; i++) {
>          if (libxl_device_pci_remove(ctx, domid, pcidevs + i) < 0)
>              return ERROR_FAIL; 

I have a feeling this is responsible for my getting this message:
        libxl: error: libxl.c:851:libxl_domain_destroy pci shutdown failed for 
domid 2
when shutting down a PV domain which has no PCI devices assigned to it. 

Presumably this is because libxl_device_pci_list_assigned() returns
error if "backend/pci/%d/0/num_devs" does not exist in xenstore, which
it won't for a domain with no devices passed through.

Ian.



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