[libvirt] [PATCH] use poweroff not halt for virsh shutdown

"halt" means just that, and we want to "poweroff". Linux doesn't care, but Solaris differentiates between the two. Signed-off-by: John Levon <john.levon@sun.com> Index: src/xend_internal.c =================================================================== RCS file: /data/cvs/libvirt/src/xend_internal.c,v retrieving revision 1.211 diff -u -r1.211 xend_internal.c --- src/xend_internal.c 28 Aug 2008 11:59:07 -0000 1.211 +++ src/xend_internal.c 28 Aug 2008 14:04:21 -0000 @@ -2884,7 +2884,7 @@ } if (domain->id < 0) return(-1); - return xend_op(domain->conn, domain->name, "op", "shutdown", "reason", "halt", NULL); + return xend_op(domain->conn, domain->name, "op", "shutdown", "reason", "poweroff", NULL); } /** Index: src/xs_internal.c =================================================================== RCS file: /data/cvs/libvirt/src/xs_internal.c,v retrieving revision 1.68 diff -u -r1.68 xs_internal.c --- src/xs_internal.c 20 Aug 2008 20:48:36 -0000 1.68 +++ src/xs_internal.c 28 Aug 2008 14:04:22 -0000 @@ -654,7 +654,7 @@ * this is very hackish, the domU kernel probes for a special * node in the xenstore and launch the shutdown command if found. */ - return(virDomainDoStoreWrite(domain, "control/shutdown", "halt")); + return(virDomainDoStoreWrite(domain, "control/shutdown", "poweroff")); } /**

On Thu, Aug 28, 2008 at 03:05:32PM +0100, John Levon wrote:
"halt" means just that, and we want to "poweroff". Linux doesn't care, but Solaris differentiates between the two.
ACK, confirmed Linux treats them identically drivers/xen/core/reboot.c THe control/shutdown xenstore watch fires shutdown_handler(), which sets up a job for __shutdown_handler(), which runs shutdown_process() which does if ((shutting_down == SHUTDOWN_POWEROFF) || (shutting_down == SHUTDOWN_HALT)) { if (call_usermodehelper("/sbin/poweroff", poweroff_argv, envp, 0) < 0) { Semantically 'poweroff' is what we're wanting for virDomainShutdown(). Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Thu, Aug 28, 2008 at 03:05:32PM +0100, John Levon wrote:
"halt" means just that, and we want to "poweroff". Linux doesn't care, but Solaris differentiates between the two.
Okay, makes sense, applied and commited, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
John Levon