Stefan Berger
2007-May-05 14:42 UTC
[Xen-devel] [PATCH] [Xen-API] Patch for fixing the rtc/timeoffset entry
This patch rewrites the rtc/timeoffset entry so the VM''s record can be retrieved with the Java xmlrpc library. If the entry is ''None'' it upsets the xmlrpc parser. This fixes it, though maybe there''s a better place in xend to place similar code. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-May-07 13:01 UTC
Re: [Xen-devel] [PATCH] [Xen-API] Patch for fixing the rtc/timeoffset entry
On 5/5/07 15:42, "Stefan Berger" <stefanb@us.ibm.com> wrote:> This patch rewrites the rtc/timeoffset entry so the VM''s record can be > retrieved with the Java xmlrpc library. If the entry is ''None'' it upsets > the xmlrpc parser. This fixes it, though maybe there''s a better place in > xend to place similar code.Can''t the second argument to vm_details.get() be changed to "0"? If not, could you just do ''foo = vm_details.get(...) or "0"''? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefan Berger
2007-May-07 16:40 UTC
Re: [Xen-devel] [PATCH] [Xen-API] Patch for fixing the rtc/timeoffset entry
Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote on 05/07/2007 09:01:59 AM:> On 5/5/07 15:42, "Stefan Berger" <stefanb@us.ibm.com> wrote: > > > This patch rewrites the rtc/timeoffset entry so the VM''s record can be > > retrieved with the Java xmlrpc library. If the entry is ''None'' itupsets> > the xmlrpc parser. This fixes it, though maybe there''s a better placein> > xend to place similar code. > > Can''t the second argument to vm_details.get() be changed to "0"? If not, > could you just do ''foo = vm_details.get(...) or "0"''?The problem is that the ''get'' only falls back to the default (currently passed as ''0''), if the member of the dictionary is not set at all. Unfortunately the member has the value ''None''. Probably the value "0" should be assigned in the initialization of the dictionary. Stefan> > -- Keir > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefan Berger
2007-May-07 19:55 UTC
Re: [Xen-devel] [PATCH] [Xen-API] Patch for fixing the rtc/timeoffset entry
A simpler solution below:
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Stefan
diff -r 3a5722420de7 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Thu May 03
19:25:47 2007 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py Mon May 07
16:33:14 2007 -0400
@@ -868,6 +868,9 @@ class XendDomainInfo:
# convert two lists into a python dictionary
vm_details = dict(zip(cfg_vm, vm_details))
+ if vm_details[''rtc/timeoffset''] == None:
+ vm_details[''rtc/timeoffset''] = "0"
+
for arg, val in vm_details.items():
if arg in XendConfig.LEGACY_CFG_TO_XENAPI_CFG:
xapiarg = XendConfig.LEGACY_CFG_TO_XENAPI_CFG[arg]
Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote on 05/07/2007 09:01:59 AM:
> On 5/5/07 15:42, "Stefan Berger" <stefanb@us.ibm.com>
wrote:
>
> > This patch rewrites the rtc/timeoffset entry so the VM''s
record can be
> > retrieved with the Java xmlrpc library. If the entry is
''None'' it
upsets> > the xmlrpc parser. This fixes it, though maybe there''s a
better place
in> > xend to place similar code.
>
> Can''t the second argument to vm_details.get() be changed to
"0"? If not,
> could you just do ''foo = vm_details.get(...) or
"0"''?
>
> -- Keir
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Reasonably Related Threads
- Gentoo+Xen4.0: Error: coercing to Unicode: need string or buffer, NoneType found.
- [PATCH] Fix linux compilation on x86-64
- [PATCH] [Firmware] TCG BIOS extensions for the Bochs BIOS
- [PATCH v2 1/2] xattrs: Skip security.evm extended attribute
- Gluster 1.3.12 and Xen!