From: Eric Blake Subject: Re: [Qemu-devel] [PATCH v2] event: Add source information to SHUTDOWN Date: Thu, 20 Apr 2017 15:28:14 -0500 Message-ID: References: <20170419222258.13415-1-eblake@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rBrcRnlV50apGaIkc3KGProSE0TetEuNj" Cc: Peter Maydell , "open list:Overall" , "Michael S. Tsirkin" , Mark Cave-Ayland , Alexander Graf , Scott Wood , Gerd Hoffmann , "Edgar E. Iglesias" , Rob Herring , Stefano Stabellini , Magnus Damm , armbru@redhat.com, Christian Borntraeger , Anthony Perard , "open list:X86" , Richard Henderson , Artyom Tarasenko , Eduardo Habkost , Stefan Weil , Alist To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39034 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S945402AbdDTU2v (ORCPT ); Thu, 20 Apr 2017 16:28:51 -0400 In-Reply-To: <20170419222258.13415-1-eblake@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rBrcRnlV50apGaIkc3KGProSE0TetEuNj Content-Type: multipart/mixed; boundary="E0EiK4kbWLgV6Go6L8IiGthoAcpKQvJ6m"; protected-headers="v1" From: Eric Blake To: qemu-devel@nongnu.org Cc: Peter Maydell , "open list:Overall" , "Michael S. Tsirkin" , Mark Cave-Ayland , Alexander Graf , Scott Wood , Gerd Hoffmann , "Edgar E. Iglesias" , Rob Herring , Stefano Stabellini , Magnus Damm , armbru@redhat.com, Christian Borntraeger , Anthony Perard , "open list:X86" , Richard Henderson , Artyom Tarasenko , Eduardo Habkost , Stefan Weil , Alistair Francis , "open list:Calxeda Highbank" , Jan Kiszka , Igor Mammedov , Cornelia Huck , David Gibson , Paul Burton , Max Filippov , Marcelo Tosatti , Michael Walle , "open list:New World" , Yongbok Kim , Paolo Bonzini , Aurelien Jarno Message-ID: Subject: Re: [Qemu-devel] [PATCH v2] event: Add source information to SHUTDOWN References: <20170419222258.13415-1-eblake@redhat.com> In-Reply-To: <20170419222258.13415-1-eblake@redhat.com> --E0EiK4kbWLgV6Go6L8IiGthoAcpKQvJ6m Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04/19/2017 05:22 PM, Eric Blake wrote: > Libvirt would like to be able to distinguish between a SHUTDOWN > event triggered solely by guest request and one triggered by a > SIGTERM or other action on the host. qemu_kill_report() is > already able to tell whether a shutdown was triggered by a host > signal (but NOT by a host UI event, such as clicking the X on > the window), but that information was then lost after being > printed to stderr. >=20 > Enhance the shutdown request path to take a parameter of which > way it is being triggered, and update ALL callers. It would have > been less churn to keep the common case with no arguments as > meaning guest-triggered, and only modified the host-triggered > code paths, via a wrapper function, but then we'd still have to > audit that I didn't miss any host-triggered spots; changing the > signature forces us to double-check that I correctly categorized > all callers. >=20 > Here is output from 'virsh qemu-monitor-event --loop' with the > patch installed: >=20 > event SHUTDOWN at 1492639680.731251 for domain fedora_13: {"guest":true= } > event STOP at 1492639680.732116 for domain fedora_13: > event SHUTDOWN at 1492639680.732830 for domain fedora_13: {"guest":fals= e} Another reason I'll need a v3: at least qemu-iotests 87 has to be updated for new expected output. --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --E0EiK4kbWLgV6Go6L8IiGthoAcpKQvJ6m-- --rBrcRnlV50apGaIkc3KGProSE0TetEuNj 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+RneAAoJEKeha0olJ0NqbaQH/3QPSDMwQQPP++YfbHSPpWhQ H/XceYryP1bFidJ1BOtcmM5w4BSHqjPXCALbq+bF4Z9A9WsY4ffxdxvWDUpH71Z1 qAQuTgUUEM+LFpKMlV8WMjulmmQbHVKjURtzIjtuQluK/RtZ8m8/5NtAMvFXH1QO YmWmMrQOZrRkJ89/e6yo1QQ5Xuro8Sd9nWeI3uvhBGCs2/kyOD2wt5M3l+zMDV22 wQ2pE3aKn3emZv5yqThOe69gSisiOyPt9xPysQmII+08Ni/smAuQo2kkZAqTF76q yhMygaDft61exPOi81wVCynFpeii3MiDHdleLW71F+iZIOmonZl29rkr3Yj7tpw= =8Anw -----END PGP SIGNATURE----- --rBrcRnlV50apGaIkc3KGProSE0TetEuNj--