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: add all pci devices to xenstore at once (

To: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] libxl: add all pci devices to xenstore at once (during VM create)
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Fri, 10 Jun 2011 11:50:39 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 10 Jun 2011 03:47:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4b392511ae0840fba66c.1307661585@devel14>
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>
References: <4b392511ae0840fba66c.1307661585@devel14>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Fri, 10 Jun 2011, Marek Marczykowski wrote:
> # HG changeset patch
> # User Marek Marczykowski <marmarek@xxxxxxxxxxxx>
> # Date 1307661438 -7200
> # Node ID 4b392511ae0840fba66c40aa2788dc1ff402b6e8
> # Parent  b2b8fef3732c10f012fc209d2850e80d95471582
> libxl: add all pci devices to xenstore at once (during VM create)
> 
> When adding pci devices one by one, pciback notice only the first one. For
> every next, "state" is left as is (usualy "4" in that time), so backend will
> not rescan xenstore. So when VM is starting all devices should be added at 
> once
> and then backend can initialize it.
> 
> This applies only to pci, because only pci backend have one xenstore dir for
> multiple devices.
> 
> Signed-off-by: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
> 
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -521,6 +521,12 @@ static int do_domain_create(libxl__gc *g
>  
>      for (i = 0; i < d_config->num_pcidevs; i++)
>          libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], 1);
> +    ret = libxl__create_pci_backend(gc, domid, d_config->pcidevs, 
> d_config->num_pcidevs);
> +    if (ret < 0) {
> +        fprintf(stderr,"xl: fatal error: %s:%d, rc=%d: 
> libxl_create_pci_backend\n",
> +                __FILE__,__LINE__, ret);
> +        goto error_out;
> +    }
>  
>      if ( cb && (d_config->c_info.hvm || d_config->b_info.u.pv.bootloader )) {
>          if ( (*cb)(ctx, domid, priv) )

Please use LIBXL__LOG rather than fprintf.
The rest of the patch is fine, thanks.


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