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] With PERMISSIVE turned on, diagnose missi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] With PERMISSIVE turned on, diagnose missing Enums and Bools, and improve the
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 04 Dec 2006 21:50:13 +0000
Delivery-date: Mon, 04 Dec 2006 13:49:39 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID 38ad5643aafef916c4411b0d28aa56277c4ff70c
# Parent  fd28a1b139dea91b8bfcf06dd233dbdda8f51ff1
With PERMISSIVE turned on, diagnose missing Enums and Bools, and improve the
diagnosis of missing structure values.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/libxen/src/xen_common.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff -r fd28a1b139de -r 38ad5643aafe tools/libxen/src/xen_common.c
--- a/tools/libxen/src/xen_common.c     Mon Dec 04 09:29:26 2006 +0000
+++ b/tools/libxen/src/xen_common.c     Mon Dec 04 10:20:56 2006 +0000
@@ -518,8 +518,14 @@ static void parse_into(xen_session *s, x
         xmlChar *string = string_from_value(value_node, "string");
         if (string == NULL)
         {
+#if PERMISSIVE
+            fprintf(stderr,
+                    "Expected an Enum from the server, but didn't get one\n");
+            ((int *)value)[slot] = 0;
+#else
             server_error(
                 s, "Expected an Enum from the server, but didn't get one");
+#endif
         }
         else
         {
@@ -567,8 +573,14 @@ static void parse_into(xen_session *s, x
         xmlChar *string = string_from_value(value_node, "boolean");
         if (string == NULL)
         {
+#if PERMISSIVE
+            fprintf(stderr,
+                    "Expected a Bool from the server, but didn't get one\n");
+            ((bool *)value)[slot] = false;
+#else
             server_error(
                 s, "Expected a Bool from the server, but didn't get one");
+#endif
         }
         else
         {
@@ -764,7 +776,6 @@ static void parse_into(xen_session *s, x
                 cur = cur->next;
             }
 
-#if !PERMISSIVE
             /* Check that we've filled all fields. */
             for (size_t i = 0; i < member_count; i++)
             {
@@ -781,15 +792,20 @@ static void parse_into(xen_session *s, x
 
                 if (j == seen_count)
                 {
+#if PERMISSIVE
+                    fprintf(stderr,
+                            "Struct did not contain expected field %s.\n",
+                            mem->key);
+#else
                     server_error_2(s,
                                    "Struct did not contain expected field",
                                    mem->key);
                     free(result);
                     free(checklist);
                     return;
+#endif
                 }
             }
-#endif
 
             free(checklist);
             ((void **)value)[slot] = result;

_______________________________________________
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] With PERMISSIVE turned on, diagnose missing Enums and Bools, and improve the, Xen patchbot-unstable <=