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-changelog

[Xen-changelog] [xen-unstable] libxl: Allocate memory for strings in lib

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: Allocate memory for strings in libxl_device_disk
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 28 Jun 2011 07:44:32 +0100
Delivery-date: Mon, 27 Jun 2011 23:51:27 -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 1309191890 -3600
# Node ID 6656d80b4de4c8c5e04ef4c9569fbaf71bcb9e6e
# Parent  5c353f53c8e21e3c006e4ac759354a4b50e8e310
libxl: Allocate memory for strings in libxl_device_disk

Memory for strings in libxl_device_disk must be allocated from outside of
libxl__gc to not be freed at the end of function (by libxl__free_all).

Fixes xl block-detach

Signed-off-by: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 5c353f53c8e2 -r 6656d80b4de4 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Mon Jun 27 17:20:55 2011 +0100
+++ b/tools/libxl/libxl_utils.c Mon Jun 27 17:24:50 2011 +0100
@@ -551,10 +551,12 @@
         goto out;
     disk->backend_domid = strtoul(val, NULL, 10);
     be_path = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/backend", 
diskpath));
-    disk->pdev_path = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, 
"%s/params", be_path));
+    disk->pdev_path = xs_read(ctx->xsh, XBT_NULL,
+                              libxl__sprintf(&gc, "%s/params", be_path), NULL);
     val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/type", 
be_path));
     libxl_string_to_backend(ctx, val, &(disk->backend));
-    disk->vdev = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/dev", 
be_path));
+    disk->vdev = xs_read(ctx->xsh, XBT_NULL,
+                         libxl__sprintf(&gc, "%s/dev", be_path), NULL);
     val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/removable", 
be_path));
     disk->removable = !strcmp(val, "1");
     val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/mode", 
be_path));

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: Allocate memory for strings in libxl_device_disk, Xen patchbot-unstable <=