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-devel] [PATCH] xl: Return error when no userdata exists

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xl: Return error when no userdata exists
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Thu, 27 Jan 2011 10:34:09 -0700
Delivery-date: Thu, 27 Jan 2011 09:35:07 -0800
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
# HG changeset patch
# User Jim Fehlig <jfehlig@xxxxxxxxxx>
# Date 1296149593 25200
# Node ID aa57d7b164e246fb4cf8e971b890bfeb3a287fa9
# Parent  b59f04eb89786e5ae6cb99c5f5dcd8e3790bc3eb
xl: Return error when no userdata exists

The libvirt libxenlight driver will store its own userdata with
id 'libvirt-xml', but currently libxl_userdata_retrieve() does
not fail on non-existent userdata due to inverted error check.

Fix error checking of libxl_read_file_contents() results.

    Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>

diff -r b59f04eb8978 -r aa57d7b164e2 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Fri Jan 21 18:06:23 2011 +0000
+++ b/tools/libxl/libxl_dom.c   Thu Jan 27 10:33:13 2011 -0700
@@ -672,7 +672,7 @@
     e = libxl_read_file_contents(ctx, filename, data_r ? &data : 0, &datalen);
-    if (!e && !datalen) {
+    if (e && !datalen) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "userdata file %s is empty", 
         if (data_r) assert(!*data_r);
         rc = ERROR_FAIL;

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>