Skip to contentSkip to conversation

Fix deregister in XendAPIStore to show correct error message.

PATCH In review Masaki Kanno 2 participants 3 messages Jul 25, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix deregister in XendAPIStore to show correct error message.

Hi,

When I tested xm create command with a wrong parameter, I saw a strange error message as follows. I attach xend.log when the error message was shown.

# xm create vm1 vcpus=99
Using config file "/etc/xen/vm1".
Error: ('2ee0aea0-0a87-6d9a-7078-3b3f90a68119', 'VM_metrics')

This patch solves the problem.

Best regards,
Kan

[2008-07-25 15:28:40 3701] DEBUG (XendDomainInfo:89) XendDomainInfo.create([\047vm\047, [\047name\047, \047vm1\047], [\047memory\047, 256], [\047vcpus\047, 99], [\047on_xend_start\047, \047ignore\047], [\047on_xend_stop\047, \047ignore\047], [\047image\047, [\047linux\047, [\047kernel\047, \047/boot/vmlinux-2.6.18.8-xen\047], [\047ramdisk\047, \047/boot/initrd-2.6.18.8-xen-vm1.img\047], [\047root\047, \047/dev/hda1 ro\047], [\047args\047, \0473 xencons=xvc console=xvc0\047]]], [\047device\047, [\047vbd\047, [\047uname\047, \047file:/xen/root-vm1.img\047], [\047dev\047, \047hda1\047], [\047mode\047, \047w\047]]], [\047device\047, [\047vif\047]]]) [2008-07-25 15:28:40 3701] DEBUG (XendDomainInfo:2022) XendDomainInfo.constructDomain
[2008-07-25 15:28:40 3701] DEBUG (balloon:132) Balloon: 64252 KiB free; need 2048; done.
[2008-07-25 15:28:40 3701] ERROR (XendDomainInfo:445) VM start failed
Traceback (most recent call last):
File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 424, in start
XendTask.log_progress(0, 30, self._constructDomain)
File "//usr/lib/python/xen/xend/XendTask.py", line 209, in log_progress
retval = func(*args, **kwds)
File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 2082, in _constructDomain

    xc.domain_max_vcpus(self.domid, int(self.info[\047VCPUs_max\047]))

Error: (22, \047Invalid argument\047)
[2008-07-25 15:28:40 3701] DEBUG (XendDomainInfo:2377) XendDomainInfo.destroy: domid=1 [2008-07-25 15:28:40 3701] DEBUG (XendDomainInfo:2394) XendDomainInfo.destroyDomain(1) [2008-07-25 15:28:40 3701] DEBUG (XendDomainInfo:1938) No device model [2008-07-25 15:28:40 3701] DEBUG (XendDomainInfo:1940) Releasing devices [2008-07-25 15:28:40 3701] ERROR (XendDomainInfo:94) Domain construction failed Traceback (most recent call last):
File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 92, in create

    vm.start()
  File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 424, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "//usr/lib/python/xen/xend/XendTask.py", line 209, in log_progress
    retval = func(*args, **kwds)
  File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 2082, in _constructDomain
    xc.domain_max_vcpus(self.domid, int(self.info[\047VCPUs_max\047]))

Error: (22, \047Invalid argument\047)
[2008-07-25 15:28:40 3701] DEBUG (XendDomainInfo:2377) XendDomainInfo.destroy: domid=None [2008-07-25 15:28:40 3701] ERROR (xmlrpclib2:178) Internal error handling xend.domain.create Traceback (most recent call last):
File "//usr/lib/python/xen/util/xmlrpclib2.py", line 131, in _marshaled_dispatch
response = self._dispatch(method, params)
File "/usr/lib/python2.4/SimpleXMLRPCServer.py", line 406, in _dispatch
return func(*params)
File "//usr/lib/python/xen/xend/server/XMLRPCServer.py", line 79, in domain_create
info = XendDomain.instance().domain_create(config)
File "//usr/lib/python/xen/xend/XendDomain.py", line 965, in domain_create
dominfo = XendDomainInfo.create(config)
File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 95, in create
vm.destroy()
File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 2381, in destroy
self._cleanupVm()
File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 2623, in _cleanupVm
self.metrics.destroy()
File "//usr/lib/python/xen/xend/XendBase.py", line 94, in destroy
XendAPIStore.deregister(self.get_uuid(), self.getClass())
File "//usr/lib/python/xen/xend/XendAPIStore.py", line 36, in deregister

    del __classes[(uuid, type)]

KeyError: (\0472ee0aea0-0a87-6d9a-7078-3b3f90a68119\047, \047VM_metrics\047)

tools/python/xen/xend/XendAPIStore.py +2 -1
diff -r 092a15aa2430 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
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

RE: [PATCH] Fix deregister in XendAPIStore to show correcterror message.

Quoted 11 lines · Masaki Kanno

Hi,

When I tested xm create command with a wrong parameter, I saw a strange error message as follows. I attach xend.log when the error message was shown.

# xm create vm1 vcpus=99
Using config file "/etc/xen/vm1".
Error: ('2ee0aea0-0a87-6d9a-7078-3b3f90a68119', 'VM_metrics')
Quoted 6 lines

This patch solves the problem.

Best regards,
Kan

Oh, I didn't see this mail in time and several minutes after your mail, I also posted a patch to fix the same issue. :-)

Thanks,
-- Dexuan

#2 lore raw

Re: [PATCH] Fix deregister in XendAPIStore to show correcterror message.

In reply to Masaki Kanno

Hi,

I withdraw my patch. Could you apply Dexuan's patch?

Best regards,
Kan

Quoted 24 lines · Masaki Kanno

Hi,

When I tested xm create command with a wrong parameter, I saw a strange error message as follows. I attach xend.log when the error message was shown.

# xm create vm1 vcpus=99
Using config file "/etc/xen/vm1".
Error: ('2ee0aea0-0a87-6d9a-7078-3b3f90a68119', 'VM_metrics')

This patch solves the problem.

Best regards,
Kan

-------------------------------text/plain-------------------------------
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel