From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Blake Subject: Re: [Qemu-devel] [PATCH v2] event: Add source information to SHUTDOWN Date: Thu, 20 Apr 2017 14:05:18 -0500 Message-ID: <53bc367e-df07-be34-25c5-dbf0b3ee174e@redhat.com> References: <20170419222258.13415-1-eblake@redhat.com> <87k26fffxa.fsf@dusky.pond.sub.org> <1adf2797-b86a-00be-bb98-658ee8d0a55d@redhat.com> <87lgqv833h.fsf@dusky.pond.sub.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vH7BL4FPskm3aeOscikoBnikhExPXU7iL" Cc: Peter Maydell , "open list:Overall" , "Michael S. Tsirkin" , Mark Cave-Ayland , qemu-devel@nongnu.org, Cornelia Huck , Gerd Hoffmann , "Edgar E. Iglesias" , Rob Herring , Stefano Stabellini , Magnus Damm , Alexander Graf , Christian Borntraeger , Anthony Perard , "open list:X86" , David Gibson , Artyom Tarasenko , Eduardo Habkost , Stefan Weil To: Markus Armbruster Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34288 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942719AbdDTTFc (ORCPT ); Thu, 20 Apr 2017 15:05:32 -0400 In-Reply-To: <87lgqv833h.fsf@dusky.pond.sub.org> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vH7BL4FPskm3aeOscikoBnikhExPXU7iL Content-Type: multipart/mixed; boundary="jLVWUKgmn24FRRGibikJvQS9RF2vk9Sro"; protected-headers="v1" From: Eric Blake To: Markus Armbruster Cc: Peter Maydell , "open list:Overall" , "Michael S. Tsirkin" , Mark Cave-Ayland , qemu-devel@nongnu.org, Cornelia Huck , Gerd Hoffmann , "Edgar E. Iglesias" , Rob Herring , Stefano Stabellini , Magnus Damm , Alexander Graf , Christian Borntraeger , Anthony Perard , "open list:X86" , David Gibson , Artyom Tarasenko , Eduardo Habkost , Stefan Weil , Alistair Francis , "open list:Calxeda Highbank" , Jan Kiszka , Paolo Bonzini , Scott Wood , Richard Henderson , Paul Burton , Max Filippov , Marcelo Tosatti , Michael Walle , "open list:New World" , Yongbok Kim , Igor Mammedov , Aurelien Jarno Message-ID: <53bc367e-df07-be34-25c5-dbf0b3ee174e@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] event: Add source information to SHUTDOWN References: <20170419222258.13415-1-eblake@redhat.com> <87k26fffxa.fsf@dusky.pond.sub.org> <1adf2797-b86a-00be-bb98-658ee8d0a55d@redhat.com> <87lgqv833h.fsf@dusky.pond.sub.org> In-Reply-To: <87lgqv833h.fsf@dusky.pond.sub.org> --jLVWUKgmn24FRRGibikJvQS9RF2vk9Sro Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04/20/2017 11:18 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> On 04/20/2017 06:59 AM, Markus Armbruster wrote: >> >>> >>> No objection to Alistair's idea to turn this into an enumeration. >> >> Question - should the enum be more than just 'guest' and 'host'? For >> example, my patch proves that we have a lot of places that handle >> complimentary machine commands to reset and shutdown, and that whether= >> 'reset' triggers a reset (and the guest keeps running as if rebooted) = or >> a shutdown is then based on the command-line arguments given to qemu. >> So having the enum differentiate between 'guest-reset' and >> 'guest-shutdown' would be a possibility, if we want the enum to have >> additional states. >=20 > I don't know. What I do know is that we better get the enum right: > while adding members is backwards-compatible, changing the member sent > for a specific trigger is not. If we want to reserve the option to do > that anyway, we need suitable documentation. Or even this idea: { 'enum': 'ShutdownCause', 'data': [ 'shutdown', 'reset', 'panic' ] } { 'event': 'SHUTDOWN', 'data': { 'guest': 'bool', '*cause': 'ShutdownCause' } } where the enum can grow as we come up with ever more reasons worth exposing (maybe even 'qmp', 'gui' and 'interrupt' are reasonable causes for a host shutdown). Our promise would be that 'guest' never changes for an existing shutdown reason, but that 'cause' may become more refined over time if someone expresses a need for having the distinction.= Thoughts? --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --jLVWUKgmn24FRRGibikJvQS9RF2vk9Sro-- --vH7BL4FPskm3aeOscikoBnikhExPXU7iL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJY+QZuAAoJEKeha0olJ0Nq8eoH/15t11zZAIQvrpYBnHxxlwUb ThZ7v0LVQ0cnKvf685HivxtchYmBaikvo380r/yphov4/kuatI6QWkV/Hke+YHaV +BnxkvI3G6HoyVZvRTWNWi5t7L5dY4PNDrAYySWmBwS1N0h4l8YogTXCq26BMhJo 5BbFL04YCn9jF2K/ZS+gTFd/Y8fHw9AG+OdiCS3IKAgriuz4+6EDH+Dd6ul6icux 0oHgMBCXIu6E8+7YIPEgdNUpVP8hlcMXeCsBC6aHsHk7cXKdEzKseu7k4lq+7aga P60tbxjkCWLhfmRoqfoEkjEVfBFEvXuJ0qOxvWs6sF9iIsQHm3DFnavk8C4TCOA= =JX4c -----END PGP SIGNATURE----- --vH7BL4FPskm3aeOscikoBnikhExPXU7iL--