]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: Have READ_LIBXLDEV use libxl_path rather than be_path
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 3 May 2016 14:40:18 +0000 (15:40 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 6 Jun 2016 16:21:52 +0000 (17:21 +0100)
Fix the just-introduced bug in this macro: now it reads the
trustworthy libxl_path.  Change the variable name in the two functions
(nic and channel) which use it.

Shuffling the bump in the carpet along, we now introduce three new
bugs: the three call sites pass a backend path where a frontend path
is expected.

No functional change.

This is part of XSA-178.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl.c

index 5e184c54c6dd8bf2239f318bfd474c7b39641a6d..42cc24e0b0228550e31219b38bb2acc1ea4a7d46 100644 (file)
@@ -2991,7 +2991,7 @@ out:
 }
 
 static void libxl__device_nic_from_xenstore(libxl__gc *gc,
-                                         const char *be_path,
+                                        const char *libxl_path,
                                          libxl_device_nic *nic)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
@@ -3002,7 +3002,7 @@ static void libxl__device_nic_from_xenstore(libxl__gc *gc,
     libxl_device_nic_init(nic);
 
     tmp = xs_read(ctx->xsh, XBT_NULL,
-                  libxl__sprintf(gc, "%s/handle", be_path), &len);
+                  libxl__sprintf(gc, "%s/handle", libxl_path), &len);
     if ( tmp )
         nic->devid = atoi(tmp);
     else
@@ -3011,19 +3011,19 @@ static void libxl__device_nic_from_xenstore(libxl__gc *gc,
     /* nic->mtu = */
 
     tmp = xs_read(ctx->xsh, XBT_NULL,
-                  libxl__sprintf(gc, "%s/mac", be_path), &len);
+                  libxl__sprintf(gc, "%s/mac", libxl_path), &len);
     rc = libxl__parse_mac(tmp, nic->mac);
     if (rc)
         memset(nic->mac, 0, sizeof(nic->mac));
 
     nic->ip = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/ip", be_path), &len);
+                      libxl__sprintf(gc, "%s/ip", libxl_path), &len);
 
     nic->bridge = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/bridge", be_path), &len);
+                      libxl__sprintf(gc, "%s/bridge", libxl_path), &len);
 
     nic->script = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/script", be_path), &len);
+                      libxl__sprintf(gc, "%s/script", libxl_path), &len);
 
     /* vif_ioemu nics use the same xenstore entries as vif interfaces */
     nic->nictype = LIBXL_NIC_TYPE_VIF;