Robert Hofer
2012-Dec-03 14:35 UTC
[Pkg-xen-devel] Bug#695041: "service xendomains stop" sleeps XENDOMAINS_STOP_MAXWAIT seconds for every domain
Package: xen-utils-common Version: 4.1.3-4 Function check_running in /etc/init.d/xendomains incorrectly detects a not running domain as running. As a consequence thereof "/etc/init.d/xendomains stop" needs more than XENDOMAINS_STOP_MAXWAIT * "number of xen domains known to xend" seconds to run. Here is a pseudo call trace: do_stop_shutdown() { ... while read id name rest; do log_action_begin_msg "Waiting for Xen domain $name ($id) to shut down" timeout_domain "$name" "$XENDOMAINS_STOP_MAXWAIT" log_action_end_msg $? done < <(/usr/lib/xen-common/bin/xen-init-list) } so timeout_domain is called with the name of the domain. timeout_domain() { name="$1" TIMEOUT="$2" for no in $(seq 0 $TIMEOUT); do if ! check_running "$name"; then return 0; fi ... so check_running is also called with the name check_running() { xen domid "$1" > /dev/null 2>&1 return $? } The output of "xm domid <name>" for a running domain is the ID of the domain and "None" for a known, but not runing domain. The return code for both cases is 0. So the function always returns 0. With xen 3 and no xend, this code was correct. I suggest to parse the output of "xm list -l <name> " for "(status 0)". I am using Debian wheezy/sid with kernel 3.2.0-4-amd64. xen-tool-stack is /usr/lib/xen-4.1/bin/xm
Bastian Blank
2012-Dec-03 15:05 UTC
[Pkg-xen-devel] Bug#695041: Bug#695041: "service xendomains stop" sleeps XENDOMAINS_STOP_MAXWAIT seconds for every domain
On Mon, Dec 03, 2012 at 03:35:05PM +0100, Robert Hofer wrote:> so check_running is also called with the name > The output of "xm domid <name>" for a running domain is the ID of > the domain and "None" for a known, but not runing domain. The return > code for both cases is 0. So the function always returns 0. With xen > 3 and no xend, this code was correct.With xl and 4.1: | # xen domid test; echo $? | Can't get domid of domain name 'test', maybe this domain does not exist. | 1 With xm and 4.1: | # xen domid test; echo $? | Error: Domain 'test' does not exist. | 3 So this command fails for not existing domains.> I suggest to parse the output of "xm list -l <name> " for "(status 0)".Nope, this does not work. Bastian -- It is a human characteristic to love little animals, especially if they're attractive in some way. -- McCoy, "The Trouble with Tribbles", stardate 4525.6
Maybe Matching Threads
- Bug#742397: xen-utils-common: /etc/init.d/dom0weight is hardcoded to use xm
- Bug#678719: xen-utils-common: please label all created directories for SE Linux
- Bug#772274: xen-utils-common: when upgrading package: insserv: Service xenstored has to be enabled to start service xendomains
- Processed: closing 726827, closing 763102, closing 711273, closing 744163, closing 603366, closing 648670 ...
- Bug#403105: seconded; pygrub