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] libxl: do not try to detach pci device when none

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] libxl: do not try to detach pci device when none attached
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Tue, 21 Jun 2011 17:34:30 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Delivery-date: Tue, 21 Jun 2011 09:35:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1106101138210.12963@kaball-desktop>
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>
Newsgroups: chiark.mail.xen.devel
References: <88f67b423c89f4bd6048.1307662408@devel14> <alpine.DEB.2.00.1106101138210.12963@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Stefano Stabellini writes ("Re: [Xen-devel] [PATCH] libxl: do not try to detach 
pci device when none attached"):
> diff -r 37c77bacb52a tools/libxl/libxl_pci.c
> --- a/tools/libxl/libxl_pci.c Mon May 23 17:38:28 2011 +0100
> +++ b/tools/libxl/libxl_pci.c Fri Jun 10 10:39:05 2011 +0000
> @@ -1022,8 +1022,7 @@ int libxl_device_pci_list_assigned(libxl
>              } while ((p = strtok_r(NULL, ",=", &saveptr)) != NULL);
>          }
>      }
> -    if ( *num )
> -        *list = pcidevs;
> +    *list = pcidevs;

This patch looks correct to me, as far as it goes.

If n==0 then calloc is passed 0 and may return 0 willy-nilly but since
there's no error check this doesn't cause other trouble :-/.

Ian.

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