[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxl: fix libxl__device_disk_from_xs_be to parse backend domid



commit a508caf0ebc4f834bd44c1d607e5b7bfabe43e3d
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Fri Sep 6 12:36:26 2013 +0200
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Fri Sep 13 13:13:31 2013 +0100

    libxl: fix libxl__device_disk_from_xs_be to parse backend domid
    
    libxl__device_disk_from_xs_be was ignoring the backend domid, setting
    it to 0 by default. Fix this by parsing the backend disk path in order
    to fetch the backend domid.
    
    This fixes the issue reported when trying to block-detach disks that
    have it's backend on a driver domain.
    
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reported-by: G.R. <firemeteor@xxxxxxxxxxxxxxxxxxxxx>
    Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/libxl.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 1bce4bb..7a7aaf9 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);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.