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:
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
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
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.
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