aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/libxl/libxl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 1bce4bb46f..7a7aaf90fe 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2234,9 +2234,16 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
libxl_ctx *ctx = libxl__gc_owner(gc);
unsigned int len;
char *tmp;
+ int rc;
libxl_device_disk_init(disk);
+ rc = sscanf(be_path, "/local/domain/%d/", &disk->backend_domid);
+ if (rc != 1) {
+ LOG(ERROR, "Unable to fetch device backend domid from %s", be_path);
+ goto cleanup;
+ }
+
/* "params" may not be present; but everything else must be. */
tmp = xs_read(ctx->xsh, XBT_NULL,
libxl__sprintf(gc, "%s/params", be_path), &len);