changeset 15788:8e3abd893835

xm: Fix error message for xm create command.

When I tested xm create command, I saw the following error message.
I expected an error message "Error: (12, 'Cannot allocate memory')"
because I intentionally caused a memory shortage on the test.
But the error message was different from my expectation.

# xm create /xen/HVMdomain.1
Using config file "/xen/HVMdomain.1".
Error: an integer is required

I looked at xend.log to examine the cause why the error message was
shown. (Could you see the attached xend.log?)
xend had the error message "Error: (12, 'Cannot allocate memory')"
first. But xend changed the error message to "Error: an integer is
required" halfway. I'm not sure about the cause why an exception
occurred in logging processing. But when I applied an attached patch,
I confirmed that the error message that I expected was shown. The
patch does not call xc.domain_destroy_hook() if self.domid is None.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Tue Aug 28 16:11:05 2007 +0100 (2007-08-28)
parents 7f53312a3297
children 8e9ec8711efa
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Aug 28 16:08:38 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Aug 28 16:11:05 2007 +0100
     1.3 @@ -1773,7 +1773,8 @@ class XendDomainInfo:
     1.5          self._cleanupVm()
     1.6          if self.dompath is not None:
     1.7 -            xc.domain_destroy_hook(self.domid)
     1.8 +            if self.domid is not None:
     1.9 +                xc.domain_destroy_hook(self.domid)
    1.10              self.destroyDomain()
    1.12          self._cleanup_phantom_devs(paths)