From: "Jun Zhu (Intern)" Subject: [PATCH]:make libxl uses config file compatible with xm config file Date: Tue, 21 Sep 2010 17:57:33 +0100 Message-ID: <433DDF91DFB08148BAD3FDB6FDDA314C9F3703C5FB@LONPMAILBOX01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Content-Language: en-GB List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: "Jun Zhu (Intern)" List-Id: xen-devel@lists.xenproject.org disk =3D [ 'phy:sdb1,xvdb,w',] or disk =3D ['phy:va/*'] can be parsed by xm= , but cannot be used by xl. This patch makes libxl uses config file compati= ble with xm's config file. Signed-off-by:Jun Zhu 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 =3D strtok(NULL, ","); while (*p =3D=3D ' ') p++; - disk->physpath=3D strdup(p); + if (disk->phystype =3D=3D PHYSTYPE_PHY && strncmp(p, "/dev", s= trlen("/dev"))) + asprintf(&disk->physpath, "/dev/%s", p); + else + disk->physpath=3D strdup(p); p =3D strtok(NULL, ","); while (*p =3D=3D ' ') p++; Jun Zhu Citrix Systems UK=