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] XendAPIStore - do not remove non-existent item

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] XendAPIStore - do not remove non-existent item
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Tue, 03 Feb 2009 13:58:02 -0700
Delivery-date: Tue, 03 Feb 2009 12:58:43 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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/20060911)
If list is searched and item not found, then don't attempt to delete the
item.

I've seen this bug manifest as

xen81:~/bin # xm li
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  3151    16     r-----   1240.8
pxe                                          3   256     1     -b----     26.4
xen81:~/bin # xm des 3
Error: ('d59cd309-80cd-66b3-d4f3-cff439eadc8a', 'VM_metrics')
Usage: xm destroy <Domain>

Terminate a domain immediately.


I'm not sure why this vm had no metrics object associated with it but
nonetheless I don't think we should be throwing exceptions by removing
non-existent objects from XendAPIStore.

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

Index: xen-3.3.1-testing/tools/python/xen/xend/XendAPIStore.py
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendAPIStore.py
+++ xen-3.3.1-testing/tools/python/xen/xend/XendAPIStore.py
@@ -33,7 +33,8 @@ def register(uuid, type, inst):
 
 def deregister(uuid, type):
     old = get(uuid, type)
-    del __classes[(uuid, type)]
+    if old is not None:
+        del __classes[(uuid, type)]
     return old
 
 def get(uuid, type):
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] XendAPIStore - do not remove non-existent item, Jim Fehlig <=