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

[Xen-changelog] [xen stable-4.6] libxl: Cleanup: use libxl__backendpath_parse_domid in libxl__device_disk_from_xs_be



commit 5225dbb47ce646cd0cdc1aace8b2c1581bdff7ff
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Fri Apr 29 16:08:19 2016 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Mon Jun 6 15:08:59 2016 +0100

    libxl: Cleanup: use libxl__backendpath_parse_domid in 
libxl__device_disk_from_xs_be
    
    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@xxxxxxxxxxxxx>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 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 bfd7df9..ac4a668 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2665,10 +2665,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;
     }
 
     /* "params" may not be present; but everything else must be. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

_______________________________________________
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®.