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

[Xen-devel] [PATCH] [xend] Fix on-wire response for RPCs that return voi

To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] [xend] Fix on-wire response for RPCs that return void
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Fri, 17 Nov 2006 16:34:41 -0700
Delivery-date: Fri, 17 Nov 2006 15:37:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.8 (X11/20061025)
The legacy apis return a value of None on success, which was being converted to an illegal (as per Xen API spec) value of 'nil' in the xmlrpc response. An example of the invalid on-wire response:

<methodResponse>
 <params>
   <param>
     <value>
       <struct>
         <member>
           <name>Status</name>
           <value><string>Success</string></value>
         </member>
         <member>
           <name>Value</name>
           <value><nil/></value>
         </member>
       </struct>
     </value>
   </param>
 </params>
</methodResponse>


The Xen IPI spec states that destroy, hard_shutdown, pause, resume, start, suspend, and unpause return void. This patch makes it so and permits proper parsing of the response by clients (libxen) that follow the spec.

Jim

# HG changeset patch
# User jfehlig@xxxxxxxxxxxxxxxxxxxxxxxxx
# Date 1163805674 25200
# Node ID 5d168b8e743a432ba719dbb990e77164c58b080d
# Parent  f0ba459065d32b61c9d04ccde5787e48e23be782
The legacy apis return a value of None on success, which was being converted to 
a value of 'nil' in the xmlrpc response.
The Xen IPI spec states that destroy, hard_shutdown, pause, resume, start, 
suspend, and unpause return void.  This patch makes it so and permits proper 
parsing of the response by clients (libxen) that follow the spec.

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

diff -r f0ba459065d3 -r 5d168b8e743a tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Thu Nov 16 18:47:28 2006 -0800
+++ b/tools/python/xen/xend/XendAPI.py  Fri Nov 17 16:21:14 2006 -0700
@@ -257,8 +257,8 @@ def do_vm_func(fn_name, vm_ref, *args):
     """
     xendom = XendDomain.instance()
     fn = getattr(xendom, fn_name)
-    return xen_api_success(xendom.do_legacy_api_with_uuid(
-        fn, vm_ref, *args))
+    xendom.do_legacy_api_with_uuid(fn, vm_ref, *args)
+    return xen_api_success_void()
 
 
 class XendAPI:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>