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

[Xen-devel] [PATCH] xl: Return error when no userdata exists



# 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", 
filename);
         if (data_r) assert(!*data_r);
         rc = ERROR_FAIL;

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.