xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH 2/2] libxl: fix libxl__device_disk_from_xs_be to parse backend domid
Date: Fri, 6 Sep 2013 12:36:26 +0200	[thread overview]
Message-ID: <1378463786-16230-3-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1378463786-16230-1-git-send-email-roger.pau@citrix.com>

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@citrix.com>
Reported-by: G.R. <firemeteor@users.sourceforge.net>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
 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 4aa2fe3..ada9d38 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2232,9 +2232,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);
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-09-06 10:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06 10:36 [PATCH 0/2] libxl: fixes for driver domains Roger Pau Monne
2013-09-06 10:36 ` [PATCH 1/2] libxl: correctly list disks served by driver domains in block-list Roger Pau Monne
2013-09-10 10:11   ` Ian Campbell
2013-09-10 12:06     ` Roger Pau Monné
2013-09-10 12:54       ` Ian Campbell
2013-09-10 13:55         ` Roger Pau Monné
2013-09-10 14:23           ` Ian Campbell
2013-09-10 14:54             ` [PATCH] libxl: set permissions for xs frontend entry pointing to xs backend Roger Pau Monne
2013-09-10 15:02               ` Ian Campbell
2013-09-10 15:03                 ` Roger Pau Monné
2013-09-10 15:06                   ` Ian Campbell
2013-09-10 15:12               ` Ian Jackson
2013-09-10 15:16                 ` Ian Campbell
2013-09-10 15:19                   ` Ian Jackson
2013-09-10 15:23                     ` Ian Campbell
2013-09-10 15:43                       ` Ian Jackson
2013-09-10 15:19                 ` Roger Pau Monné
2013-09-10 15:24                   ` Ian Campbell
2013-09-06 10:36 ` Roger Pau Monne [this message]
2013-09-10 10:14   ` [PATCH 2/2] libxl: fix libxl__device_disk_from_xs_be to parse backend domid Ian Campbell
2013-09-10 12:08     ` Roger Pau Monné
2013-09-13 12:32       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378463786-16230-3-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).