From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrDFc-0003ta-UB for qemu-devel@nongnu.org; Mon, 15 Mar 2010 12:34:45 -0400 Received: from [199.232.76.173] (port=34330 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrDFb-0003mC-AX for qemu-devel@nongnu.org; Mon, 15 Mar 2010 12:34:43 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NrDAN-0002Vt-46 for qemu-devel@nongnu.org; Mon, 15 Mar 2010 12:29:20 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:41351) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NrDAM-0002Vp-PZ for qemu-devel@nongnu.org; Mon, 15 Mar 2010 12:29:18 -0400 Received: by ewy6 with SMTP id 6so663260ewy.16 for ; Mon, 15 Mar 2010 09:29:18 -0700 (PDT) Message-ID: <4B9E6059.3040400@codemonkey.ws> Date: Mon, 15 Mar 2010 11:29:13 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] wake-on-lan & IPMI implementation; real power-off and -no-shutdown References: <2378452091-BeMail@laptop> <20100315155526.GV26239@redhat.com> In-Reply-To: <20100315155526.GV26239@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: =?ISO-8859-1?Q?Fran=E7ois_Revol?= , qemu-devel@nongnu.org On 03/15/2010 10:55 AM, Daniel P. Berrange wrote: > On Mon, Mar 15, 2010 at 04:01:27PM +0100, Fran?ois Revol wrote: > >> Hello, >> while working on a demonstrator for a green-IT project, to show >> scheduled machine shutdown and powering depending on various >> conditions, I wondered if I could use QEMU with wake-on-lan >> transparently, but it seems it's not implemented at all. >> >> I though I could try to add support for it, and with -S it theorically >> should be doable at least for the first boot, but the network packets >> do not go much further until the NIC is actually initialized, as most >> network layers use qemu_can_send_packet() which returns 0 if the >> machine is stopped. >> Hacking this function to return 1 seems to push the packet upward, but >> I couldn't find a single point where I could check for WOL packets, >> different -net subsystems using different code paths. >> >> Also, it seems -no-shutdown doesn't actually "stop the emulation" as >> said in the manual, it actually keeps the vm running (and using cpu), >> despite the OS trying to shutdown via ACPI. At least I tested so with >> Haiku (and acpi=true in kernel config), which properly exits QEMU >> without -no-shutdown. >> > Hmm, I think -no-shutdown should at least stop the CPUs executing. It is > not really useful on its own though. The app managing QEMU would want to > use the new JSON based monitor to listen for the SHUTDOWN event to be > emitted, so it can detect the shutdown completing& then take action it > wants either reset the guest, or kill QEMU, etc > The semantics of -no-shutdown are awful. I'd personally prefer to see the option deprecated and a new set of options introduced with clearer semantics. Currently, -no-shutdown does too many things. It affects reboot behaviour, shutdown behaviour, the behavior of the SDL close button. Each of these things should be individual tunables. Regards, Anthony Liguori > Daniel >