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/
Home Products Support Community News


[Xen-changelog] [xen-unstable] libxl: Do not SEGV when no 'removable' di

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: Do not SEGV when no 'removable' disk parameter in xenstore
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 28 Jun 2011 07:44:34 +0100
Delivery-date: Mon, 27 Jun 2011 23:51:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Marek Marczykowski <marmarek@xxxxxxxxxxxx>
# Date 1309192632 -3600
# Node ID 2f63562df1c4230492a81793dce3672f93c93d9a
# Parent  cc2f376d0cd97fdb2a3d5e363f728ddd0d025bd0
libxl: Do not SEGV when no 'removable' disk parameter in xenstore

Just assume disk as not removable when no 'removable' paremeter

Signed-off-by: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r cc2f376d0cd9 -r 2f63562df1c4 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon Jun 27 17:34:01 2011 +0100
+++ b/tools/libxl/libxl.c       Mon Jun 27 17:37:12 2011 +0100
@@ -1571,6 +1571,7 @@
                              libxl__xs_get_dompath(gc, 0), type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir) {
+        char *removable;
         *disks = realloc(*disks, sizeof (libxl_device_disk) * (*ndisks + n));
         pdisk = *disks + *ndisks;
         *ndisks += n;
@@ -1588,7 +1589,12 @@
                 libxl__sprintf(gc, "%s/%s/type", be_path, *dir)), 
             pdisk->vdev = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(gc, 
"%s/%s/dev", be_path, *dir), &len);
-            pdisk->removable = atoi(libxl__xs_read(gc, XBT_NULL, 
libxl__sprintf(gc, "%s/%s/removable", be_path, *dir)));
+            removable = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
+                                       (gc, "%s/%s/removable", be_path, *dir));
+            if (removable)
+                pdisk->removable = atoi(removable);
+            else
+                pdisk->removable = 0;
             if (!strcmp(libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, 
"%s/%s/mode", be_path, *dir)), "w"))
                 pdisk->readwrite = 1;

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: Do not SEGV when no 'removable' disk parameter in xenstore, Xen patchbot-unstable <=