From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: [PATCH] XendAPIStore - do not remove non-existent item Date: Tue, 03 Feb 2009 13:58:02 -0700 Message-ID: <4988AFDA.3080609@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090408020303000104000706" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------090408020303000104000706 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 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 --------------090408020303000104000706 Content-Type: text/x-patch; name="xend-class-dereg.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xend-class-dereg.patch" 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): --------------090408020303000104000706 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------090408020303000104000706--