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] Re: [Xen-changelog] The dom destroy path is doing a dom_get

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [Xen-changelog] The dom destroy path is doing a dom_get on a non-existent domain to
From: Dan Smith <danms@xxxxxxxxxx>
Date: Wed, 14 Sep 2005 18:07:57 -0700
Cc: robert@xxxxxxxxxxxxx
Delivery-date: Thu, 15 Sep 2005 01:06:03 +0000
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/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>
References: <E1EFftK-00037x-UP@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)
> # HG changeset patch
> # User shand@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> # Node ID fb72c78604c673bb07915675620bce3b7630e323
> # Parent  122779b57b40600dcaf2d147ca82ec23da8e2c96

<snip>

> It then handles the exception in dom_get by returning None, which
> callers already expect to mean failure.

This is not actually true, right?  There are several places in the
code that blindly use the return value of dom_get(), assuming that it
is actually anything but None.  The closest example is in the update()
function, several lines down:

  self.info = info or dom_get(self.domid)
  self.memory = self.info['mem_kb'] / 1024

Clearly, we need to decide what behavior dom_get() is expected to
have.  Do we expect it to return None if the domid is not found, or do
we expect the domain we're asking about to always be present
(i.e. throw an exception if not)?

If nobody has strong feelings either way, I'll work up a patch to fix
it.

-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@xxxxxxxxxx


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

<Prev in Thread] Current Thread [Next in Thread>