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

Re: [Xen-devel] [PATCH] [Xen-API] Patch for fixing the rtc/timeoffset en

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] [Xen-API] Patch for fixing the rtc/timeoffset entry
From: Stefan Berger <stefanb@xxxxxxxxxx>
Date: Mon, 7 May 2007 15:55:01 -0400
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ewan Mellor <ewan@xxxxxxxxxxxxx>
Delivery-date: Mon, 07 May 2007 12:53:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C264E1D7.6EB4%Keir.Fraser@xxxxxxxxxxxx>
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

A simpler solution below:


  Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>

  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@xxxxxxxxxxxx> wrote on 05/07/2007 09:01:59 AM:

> On 5/5/07 15:42, "Stefan Berger" <stefanb@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>