All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xl: Return error when no userdata exists
@ 2011-01-27 17:34 Jim Fehlig
  2011-01-27 18:57 ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Fehlig @ 2011-01-27 17:34 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Jim Fehlig <jfehlig@novell.com>
# 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@novell.com>

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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-28 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-27 17:34 [PATCH] xl: Return error when no userdata exists Jim Fehlig
2011-01-27 18:57 ` Ian Jackson
2011-01-27 19:10   ` Jim Fehlig
2011-01-28 16:44     ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.