WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxl: fail to parse disk vpath if a disk+part numbe

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxl: fail to parse disk vpath if a disk+part number is required but unavailable
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Thu, 23 Jun 2011 17:10:26 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Thu, 23 Jun 2011 09:11:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1308843343 -3600
# Node ID 4fa92ff6c6156c2723d716a48c041dcb2c92938b
# Parent  18476e67178555b92b9bf893a3c550a9095caef8
libxl: fail to parse disk vpath if a disk+part number is required but 
unavailable

libxl__device_disk_dev_number() can parse a virtpath which is an encoded
unsigned long but does not set *pdisk or *ppartition in that case.

Ideally we would parse the number but for now simply fail to prevent cascading
failures.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 18476e671785 -r 4fa92ff6c615 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Thu Jun 23 16:34:08 2011 +0100
+++ b/tools/libxl/libxl_device.c        Thu Jun 23 16:35:43 2011 +0100
@@ -222,8 +222,12 @@ int libxl__device_disk_dev_number(char *
 
     errno = 0;
     ul = strtoul(virtpath, &ep, 0);
-    if (!errno && !*ep && ul <= INT_MAX)
+    if (!errno && !*ep && ul <= INT_MAX) {
+        /* FIXME: should parse ul to determine these. */
+        if (pdisk || ppartition)
+            return -1;
         return ul;
+    }
 
     if (device_virtdisk_matches(virtpath, "hd",
                                 &disk, 3,

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libxl: fail to parse disk vpath if a disk+part number is required but unavailable, Ian Campbell <=