Petter Reinholdtsen
2007-Mar-10 17:55 UTC
[Pkg-xen-devel] Bug#414294: xen-utils-common: /etc/init.d/xendomains fail to save domains with "long" names
Package: xen-utils-common
Version: 3.0.3-0-2
Severity: important patch
I ran into this problem when using xen on Debian/Etch. I have several
virtual xen instanses, and I name them using their fully qualified DNS
domain name. These machines have failed to start automatically when I
booted the host machine, and I just recently found out why. During
shutdown, I was messages like this:
Error: Domain 'o' does not exist.
Usage: xm save <Domain> <CheckpointFile>
Save a domain state to restore later.
By running '/etc/init.d/xendomains stop' manually using bash -x, I
discovered why. The code to extract the domain name is only looking
at the first 17 characters of the result reported by 'xm list', and
this is too short to get the entire domain name I use. I worked
around it by using this patch, by accepting 25 characters instead of
17.
--- /etc/init.d/xendomains.orig 2007-03-10 14:40:09.000000000 +0100
+++ /etc/init.d/xendomains 2007-03-10 14:40:21.000000000 +0100
@@ -128,9 +128,9 @@
parseln()
{
- name=`echo "$1" | cut -c0-17`
+ name=`echo "$1" | cut -c0-25`
name=${name%% *}
- rest=`echo "$1" | cut -c18- `
+ rest=`echo "$1" | cut -c26- `
read id mem cpu vcpu state tm < <(echo "$rest")
}
Perhaps it is better to use `echo "$1" | awk '{print $1}'`
instead, to
handle any width?
-- System Information:
Debian Release: 4.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.18-4-xen-686
Locale: LANG=nb_NO.UTF-8, LC_CTYPE=nb_NO.UTF-8 (charmap=UTF-8)
Versions of packages xen-utils-common depends on:
ii lsb-base 3.1-23 Linux Standard Base 3.1 init scrip
ii udev 0.105-3 /dev/ and hotplug management daemo
xen-utils-common recommends no packages.
-- no debconf information
Reasonably Related Threads
- Bug#395305: /etc/init.d/xendomains parseln() and long domU names
- Bug#772274: xen-utils-common: when upgrading package: insserv: Service xenstored has to be enabled to start service xendomains
- Bug#402974: xen-utils-common: xen domain do not always shutdown
- Error in /etc/init.d/xendomains if using option XEN_DOMAINS_AUTO_ONLY=true - saving of the domains always fails / shutdown is called
- Error in /etc/init.d/xendomains if using option XEN_DOMAINS_AUTO_ONLY=true - saving of the domains always fails / shutdown is called
