From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>, Wei Liu <wei.liu2@citrix.com>
Subject: [PATCH 2/3] libxl: Cleanup: use libxl__backendpath_parse_domid in libxl__device_disk_from_xs_be
Date: Thu, 2 Jun 2016 16:10:31 +0100 [thread overview]
Message-ID: <1464880232-893-3-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1464880232-893-1-git-send-email-ian.jackson@eu.citrix.com>
Rather than an open-coded sscanf. No functional change with correct
input.
This is a followup to XSA-175 and XSA-178.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
tools/libxl/libxl.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d5475ed..006b83f 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2658,10 +2658,10 @@ static int libxl__device_disk_from_xenstore(libxl__gc *gc,
goto out;
}
- rc = sscanf(backend_path, "/local/domain/%d/", &disk->backend_domid);
- if (rc != 1) {
+ rc = libxl__backendpath_parse_domid(gc, backend_path, &disk->backend_domid);
+ if (rc) {
LOG(ERROR, "Unable to fetch device backend domid from %s", backend_path);
- goto cleanup;
+ goto out;
}
/*
--
1.7.10.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-02 15:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 15:10 [PATCH for-4.7 0/3] XSA-175/XSA-178 followups Ian Jackson
2016-06-02 15:10 ` [PATCH 1/3] libxl: Cleanup: Have libxl__alloc_vdev use /libxl Ian Jackson
2016-06-02 15:10 ` Ian Jackson [this message]
2016-06-02 15:10 ` [PATCH 3/3] libxl: Document ~/serial/ correctly Ian Jackson
2016-06-02 15:14 ` [PATCH for-4.7 0/3] XSA-175/XSA-178 followups Wei Liu
2016-06-02 15:36 ` Wei Liu
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=1464880232-893-3-git-send-email-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xensource.com \
/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).