From: Guido Guenther Subject: Re: [PATCH] add acpi powerbutton support Date: Sun, 20 Jan 2008 12:56:17 +0100 Message-ID: <20080120115617.GA31618@bogon.ms20.nix> References: <20080103181415.GB1077@bogon.ms20.nix> <477D50FE.4040104@qumranet.com> <20080104183158.GA14002@bogon.ms20.nix> <47809A8F.5090803@qumranet.com> <20080107115916.GA24050@bogon.ms20.nix> <20080107120223.GB24050@bogon.ms20.nix> <47821EC8.4020308@qumranet.com> <20080108080928.GA9823@bogon.ms20.nix> <479219D6.1000707@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Jun Koi , public-kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f-z5DuStaUktnZ+VzJOa5vwg@public.gmane.org, Guido Guenther To: Jan Kiszka Return-path: Content-Disposition: inline In-Reply-To: <479219D6.1000707-S0/GAf8tV78@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Hi Jan, On Sat, Jan 19, 2008 at 04:40:06PM +0100, Jan Kiszka wrote: > What about additionally listening on signals? If you run qemu from the > console, you can then just press ctrl-c to shut the guest down (instead Catching ctrl-c sounds like a good idea but "ctrl-c, ctrl-c" should probably kill qemu then, since the machine might have no acpid running - in that case hitting ctrl-c would have no effect. > of killing it that way). The same happens on host shutdown (if the guest > is faster than the host's grace period before SIGKILL...). > + signal(SIGINT, qemu_powerdown_sighand); > + signal(SIGTERM, qemu_powerdown_sighand); We shouldn't catch SIGTERM here since libvirt uses it for domainDestroy() (in contrast to domainShutdown() which uses system_powerdown). Cheers, -- Guido ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/