]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: Do not trust backend for disk in getinfo
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 29 Apr 2016 18:10:45 +0000 (19:10 +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 6c59a6f41a98de2f30fae1f6e3abf55239a4d063..6f70cb8d6f175faa5e4cf301cbee563fb160e74e 100644 (file)
@@ -2827,9 +2827,8 @@ int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
     val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", fe_path));
     diskinfo->rref = val ? strtoul(val, NULL, 10) : -1;
     diskinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
-                                 libxl__sprintf(gc, "%s/frontend", diskinfo->backend), NULL);
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend-id", diskinfo->backend));
-    diskinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
+                                 GCSPRINTF("%s/frontend", libxl_path), NULL);
+    diskinfo->frontend_id = domid;
 
     GC_FREE;
     return 0;