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

Re: [Xen-devel] [PATCH 2 of 3] Check whether a PCI device is assignable before assigning it do a domU



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


 


Rackspace

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