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]:make libxl uses config file compatible with xm c

To: "Jun Zhu (Intern)" <Jun.Zhu@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH]:make libxl uses config file compatible with xm config file
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 22 Sep 2010 14:08:58 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 22 Sep 2010 06:08:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <433DDF91DFB08148BAD3FDB6FDDA314C9F3703C5FB@xxxxxxxxxxxxxxxxxxxxxxxxx>
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: <433DDF91DFB08148BAD3FDB6FDDA314C9F3703C5FB@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Tue, 21 Sep 2010, Jun Zhu (Intern) wrote:
> disk = [ 'phy:sdb1,xvdb,w',] or disk = ['phy:va/*'] can be parsed by xm, but 
> cannot be used by xl. This patch makes libxl uses config file compatible with 
> xm's config file.
> 
> Signed-off-by:Jun Zhu <Jun.Zhu@xxxxxxxxxx>
> 
> diff -r f8f4221267a2 tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c        Tue Sep 21 17:48:36 2010 +0100
> +++ b/tools/libxl/xl_cmdimpl.c        Tue Sep 21 17:53:03 2010 +0100
> @@ -781,7 +781,10 @@ static void parse_config_data(const char
>              p = strtok(NULL, ",");
>              while (*p == ' ')
>                  p++;
> -            disk->physpath= strdup(p);
> +            if (disk->phystype == PHYSTYPE_PHY && strncmp(p, "/dev", 
> strlen("/dev")))
> +                asprintf(&disk->physpath, "/dev/%s", p);
> +            else
> +                disk->physpath= strdup(p);
>              p = strtok(NULL, ",");
>              while (*p == ' ')
>                  p++;

strncmp is not enough here: you need to check for the existence of the
device and if it is not present than you can try prepending "/dev" and
see if the new device is present.

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

<Prev in Thread] Current Thread [Next in Thread>