Skip to contentSkip to conversation

domu crash on reboot, cpus reparsed -- SOLVED

PATCH Daniele Palumbo 2 participants 2 messages Jan 24, 2007 – Jan 25, 2007

lore
Share & tools
lore
#0 lore raw

hi.
this is true in 3.0.4, i think also in unstable but not sure.

when i reboot a domu, cpus is re-parsed.
but "list" type have no "split" attribute:
---
File "/usr/lib/python2.4/site-packages/xen/xend/XendConfig.py", line 556, in
_parse_sxp

    cpus = []

AttributeError: 'list' object has no attribute 'split'
---

so, i made a little patch, including that one:
http://lists.xensource.com/archives/html/xen-devel/2007-01/msg00599.html

the point is:
if(cfg[cpus]) is a list, then skip next code.

seems to work for me, no crash and cpus parsed correctly. it's up to you to close the bug i have opened
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=874
or to make a better patch :)

bye
d.

p.s.: is bugzilla alive?
p.p.s.: sorry for eventual double posting, forgot attachment and posted from non-subscribed mail

# Patch to fix xm reboot on domu.

# now cpus is correctly parsed.
#
# Idea and patch from: Daniele Palumbo <[email protected]>
# Code from: Francesco Benincasa <[email protected]> (Many thanks)
tools/python/xen/xend/XendConfig.py +2 -1
@@ -126,6 +126,7 @@
     'memory_dynamic_min': int,
     'memory_dynamic_max': int,
     'memory_actual': int,
+    'cpus': list,
     'vcpus_policy': str,
     'vcpus_params': str,
     'vcpus_number': int,
@@ -551,7 +552,7 @@
         #     "0-3,^1"   -> [0,2,3]
         #     "0-3,^1,1" -> [0,1,2,3]
         try:
-            if 'cpus' in cfg:
+            if 'cpus' in cfg and type(cfg['cpus']) != list:
                 cpus = []
                 for c in cfg['cpus'].split(','):
                     if c.find('-') != -1:             

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

#1 lore raw
Quoted 15 lines · Daniele Palumbo

hi.
this is true in 3.0.4, i think also in unstable but not sure.

when i reboot a domu, cpus is re-parsed.
but "list" type have no "split" attribute:
---
File "/usr/lib/python2.4/site-packages/xen/xend/XendConfig.py", line 556, in
_parse_sxp

    cpus = []

AttributeError: 'list' object has no attribute 'split'
---

so, i made a little patch, including that one:
http://lists.xensource.com/archives/html/xen-devel/2007-01/msg00599.html

Quoted 7 lines

the point is:
if(cfg[cpus]) is a list, then skip next code.

seems to work for me, no crash and cpus parsed correctly. it's up to you to close the bug i have opened
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=874
or to make a better patch :)

Thanks for your patch. The first hunk has been already reported, and is in xen-unstable, but I've taken the second hunk.

Ordinarily, for patches we need you to add a line to your email like this:

to indicate your acceptance of the Developer's Certificate of Origin (see
http://old.linux-foundation.org/newsroom/press_releases/2004/2004_05_24_dco.html)

Your patch is so small that I've not worried about it this time, but something to bear in mind for the future!

Thanks again,

Ewan.

Quoted 38 lines

bye
d.

p.s.: is bugzilla alive?
p.p.s.: sorry for eventual double posting, forgot attachment and posted from non-subscribed mail

# Patch to fix xm reboot on domu.

# now cpus is correctly parsed.
#
# Idea and patch from: Daniele Palumbo <[email protected]>
# Code from: Francesco Benincasa <[email protected]> (Many thanks)
tools/python/xen/xend/XendConfig.py +2 -1
@@ -126,6 +126,7 @@
     'memory_dynamic_min': int,
     'memory_dynamic_max': int,
     'memory_actual': int,
+    'cpus': list,
     'vcpus_policy': str,
     'vcpus_params': str,
     'vcpus_number': int,
@@ -551,7 +552,7 @@
         #     "0-3,^1"   -> [0,2,3]
         #     "0-3,^1,1" -> [0,1,2,3]
         try:
-            if 'cpus' in cfg:
+            if 'cpus' in cfg and type(cfg['cpus']) != list:
                 cpus = []
                 for c in cfg['cpus'].split(','):
                     if c.find('-') != -1:             

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