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

Re: [Xen-API] problem in c binding xen_event_register / xen_string_set

To: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-API] problem in c binding xen_event_register / xen_string_set
From: "Dube, Lutz" <Lutz.Dube@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Feb 2008 15:25:39 +0100
Accept-language: de-DE, en-US
Acceptlanguage: de-DE, en-US
Delivery-date: Mon, 11 Feb 2008 06:25:33 -0800
Domainkey-signature: s=s768; d=fujitsu-siemens.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:Received:Received: From:To:Date:Subject:Thread-Topic:Thread-Index:Message-ID: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:acceptlanguage:Content-Type: MIME-Version; b=wvLckiljSoki4fWPCuFbMiHtd+VzZdUmM3MmEJ9NDRXWtpZJGYaI933B Q/BPXyNfOVrdZNtbQnUYJkYSjWKfC9Pdq90/TnWehwL0uDYxewcOlWgZ7 HOet277HGgPVjq4;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Achsufn0SuGd+zkSQ4i761K5cCzHmQ==
Thread-topic: Re: [Xen-API] problem in c binding xen_event_register / xen_string_set
 
Hi,
I think, I have solved the error in libxen/src/xen_common.c.
While building the XML data for a xen-api call, the xen-api c-binding encapsulates a set of elements (in this case strings) in a <struct> tag instead of an <array> tag.
Please see patch based on xen 3.1.
 
 
--- xen_common_orig.c   2008-01-21 09:32:02.000000000 +0100
+++ xen_common.c        2008-01-28 09:02:46.000000000 +0100
@@ -90,6 +90,8 @@
static xmlNode *
add_param_struct(xmlNode *);
static xmlNode *
+add_param_array(xmlNode *);
+static xmlNode *
add_struct_array(xmlNode *, const char *);
static xmlNode *
add_nested_struct(xmlNode *, const char *);
@@ -1278,7 +1280,7 @@
         const struct abstract_type *member_type = v->type->child;
         arbitrary_set *set_val = v->u.struct_val;
         abstract_value v;
-        xmlNode *data_node = add_param_struct(params_node);
+        xmlNode *data_node = add_param_array(params_node);
 
         for (size_t i = 0; i < set_val->size; i++)
         {
@@ -1595,6 +1597,16 @@
}
 
 
+static xmlNode *
+add_param_array(xmlNode *params_node)
+{
+    xmlNode *param_node = add_container(params_node, "param");
+    xmlNode *value_node = add_container(param_node,  "value");
+
+    return xmlNewChild(value_node, NULL, BAD_CAST "array", NULL);
+}
+
+
static void
add_struct_member(xmlNode *struct_node, const char *name, const char *type,
                   const char *value)
 
 
Best regards
Lutz Dube
 
 
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-API] problem in c binding xen_event_register / xen_string_set, Dube, Lutz <=