All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] XendAPIStore - do not remove non-existent item
Date: Tue, 03 Feb 2009 13:58:02 -0700	[thread overview]
Message-ID: <4988AFDA.3080609@novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

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@novell.com>


[-- Attachment #2: xend-class-dereg.patch --]
[-- Type: text/x-patch, Size: 499 bytes --]

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):

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2009-02-03 20:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4988AFDA.3080609@novell.com \
    --to=jfehlig@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.