Bug 503290 - long xen domains do not work for storing xen guests during reboot
Summary: long xen domains do not work for storing xen guests during reboot
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen
Version: 5.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Novotny
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 514498
TreeView+ depends on / blocked
 
Reported: 2009-05-30 20:53 UTC by Florian La Roche
Modified: 2014-02-02 22:37 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-13 22:17:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch by Mark (applicable to latest RHEL-5 codebase as well) (2.82 KB, patch)
2010-08-20 14:22 UTC, Michal Novotny
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0031 0 normal SHIPPED_LIVE xen bug fix and enhancement update 2011-01-12 15:59:24 UTC

Description Florian La Roche 2009-05-30 20:53:01 UTC
Description of problem:

If XENDOMAINS_SAVE is enabled and very long domain names are used, then
saving the domains will fail.
/usr/lib/python2.4/site-packages/xen/xm/main.py contains this for "xm list":
def xm_brief_list(doms):
    print '%-40s %3s %8s %5s %5s %9s' % \
          ('Name', 'ID', 'Mem(MiB)', 'VCPUs', 'State', 'Time(s)')

But the init-Script truncates at another place: /etc/init.d/xendomain.


Here a quick fix for this:
--- /etc/init.d/xendomains
+++ /etc/init.d/xendomains
@@ -175,9 +177,9 @@

 parseln()
 {
-    name=`echo "$1" | cut -c0-17`
+    name=`echo "$1" | cut -c0-40`
     name=${name%% *}
-    rest=`echo "$1" | cut -c18- `
+    rest=`echo "$1" | cut -c41- `
     read id mem cpu vcpu state tm < <(echo "$rest")
 }


Even better would be to not rely on parsing "xm list" as already done
in other parts of the same initscript, but the above would be a good
start for RHEL5.

regards,

Florian La Roche



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Michal Novotny 2010-06-29 13:52:14 UTC
Well, based on definition with /usr/lib/python2.4/site-packages/xen/xm/main.py I guess it would be better to go with the patch from Florian rather than thinking about different logic implementation.

Michal

Comment 3 Michal Novotny 2010-08-20 14:22:30 UTC
Created attachment 439957 [details]
Patch by Mark (applicable to latest RHEL-5 codebase as well)

Well, I've been investigating this in upstream version and they have introduced in c/s 15384 at [2] to make the name working with more than 16 characters by using `xm list -l` instead of `xm list`. I tried to apply the patch with no modifications and it was working fine so I did the testing using some longer names, i.e. both short (rhel5-32fv) and long names (Red-Hat-Enterprise-Linux-5-32-bit-version) and both domains were saved (using `service xendomains stop`) and restored (using `service xendomains start`) successfully.

This is the original version from Mark (original) - the version is well-applicable to our codebase.

Michal

[1] http://xenbits.xensource.com/staging/xen-unstable.hg?rev/865c4ae59be3

Comment 7 Jinxin Zheng 2010-09-08 08:59:00 UTC
I can verify this by placing a domain whose name length is >18 chars under xendomains control, e.g:

# xm li
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0     7226     4 r-----    218.3
pv0123456789abcdefg                        2      511     1 r-----     14.5

# /etc/init.d/xendomains stop
Shutting down Xen domains: pv0123456789abcde(save).
An error occured while saving domain:
Error: Domain 'fg' does not exist.

!
(shut).
An error occured while shutting down domain:
Error: Domain 'fg' does not exist.

!
 SHUTDOWN_ALL        

[failed]                                                   [FAILED]

The above test is with xen-3.0.3-115.el5

Updated to xen-3.0.3-116.el5, this case works correctly:

...
# /etc/init.d/xendomains stop
Shutting down Xen domains: pv0123456789abcdefg(save)..........
[done]                                                     [  OK  ]

So put this bug to VERIFIED.

Comment 9 errata-xmlrpc 2011-01-13 22:17:18 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0031.html


Note You need to log in before you can comment on or make changes to this bug.