Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 234595 - xendomains init script fails to save a domain with name > 17 characters
Summary: xendomains init script fails to save a domain with name > 17 characters
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: xen
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mark McLoughlin
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-30 13:54 UTC by Mark McLoughlin
Modified: 2007-11-30 22:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-19 15:57:50 UTC


Attachments (Terms of Use)
xen-xendomains-17chars.patch (deleted)
2007-05-04 17:01 UTC, Mark McLoughlin
no flags Details | Diff

Description Mark McLoughlin 2007-03-30 13:54:11 UTC
+++ This bug was initially created as a clone of Bug #221268 +++

Description of problem:
If you have a guest running with a name greater than 17 characters in length,
the /etc/init.d/xendomains script will fail to save it upon shutdown.

Version-Release number of selected component (if applicable):
xen-3.0.3-17.el5

How reproducible:
Always

Steps to Reproduce:
1. xm rename demo  12345678901234567890123456789012345678901234567890
2. /etc/init.d/xendomains stop
3.
  
Actual results:
# /etc/init.d/xendomains  stop
Shutting down Xen domains: 12345678901234567(save)Error: Domain
'890123456789012345678901234567890' does not exist.
Usage: xm save <Domain> <CheckpointFile>

Save a domain state to restore later.
!(shut)Error: Domain '890123456789012345678901234567890' does not exist.
Usage: xm shutdown <Domain> [-waRH]

Shutdown a domain.


Expected results:
Guest is saved

Additional info:

If you look at the shell code in /etc/init.d/xendomains there's this interesting
function


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

which is used to parse the output of 'xm list'. The 'cut -c0-17' bit looks
like the obvious problem - truncating the name at 17 characters :-(

Comment 1 Mark McLoughlin 2007-03-30 13:56:32 UTC
Yep, confirmed. The weirdness comes from the fact that "xm list" used to only
allow 16 characters for the domain name.

Best fix is probably to use "xm list -l" instead of "xm list" ... that way we'll
get the full name.

Comment 2 Mark McLoughlin 2007-05-04 17:01:27 UTC
Created attachment 154140 [details]
xen-xendomains-17chars.patch

Okay, I suggest something like this (untested) patch ... it's not a bug many
people are going to hit, though, so let's delay this until after Fedora 7

Comment 3 Mark McLoughlin 2007-06-19 15:57:50 UTC
Fixed upstream by:

  changeset:   15384:865c4ae59be3
  user:        kfraser@localhost.localdomain
  date:        Tue Jun 19 16:29:22 2007 +0100
  files:       tools/examples/init.d/xendomains
  description:
  tools: Allow xendomains to handle domain names >16 characters

Closing as UPSTREAM, not really worth backporting.



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