]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: Do not trust backend for channel in getinfo
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 4 May 2016 14:57:10 +0000 (15:57 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 6 Jun 2016 14:48:35 +0000 (15:48 +0100)
Do not read the frontend path out of the backend.  We have it in our
hand.  Likewise the guest (frontend) domid was one of our parameters (!)

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 9f77269cac4d53ff2331366fb0d218d7d37bae93..35cfffe3fea9aa6d2a7fec557d525a98d32d116e 100644 (file)
@@ -3977,12 +3977,8 @@ int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
 
     val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/state", fe_path));
     channelinfo->state = val ? strtoul(val, NULL, 10) : -1;
-    channelinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
-                                    GCSPRINTF("%s/frontend",
-                                    channelinfo->backend), NULL);
-    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id",
-                         channelinfo->backend));
-    channelinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
+    channelinfo->frontend = libxl__strdup(NOGC, fe_path);
+    channelinfo->frontend_id = domid;
     val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", fe_path));
     channelinfo->rref = val ? strtoul(val, NULL, 10) : -1;
     val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/port", fe_path));