Skip to contentSkip to conversation

Fix on-wire response for RPCs that return void

PATCH Applied Jim Fehlig 2 participants 2 messages Nov 17, 2006 – Nov 22, 2006

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

PATCH 1/1 Fix on-wire response for RPCs that return void

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 [email protected]
# 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.

tools/python/xen/xend/XendAPI.py +2 -2
diff -r f0ba459065d3 -r 5d168b8e743a tools/python/xen/xend/XendAPI.py
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

Applied
#1 lore raw
Quoted 9 lines · Jim Fehlig

# HG changeset patch
# User [email protected]
# 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.

Applied, thanks Jim.

Ewan.