From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 19 16:05:19 2020 Received: (at 34276) by debbugs.gnu.org; 19 Mar 2020 20:05:19 +0000 Received: from localhost ([127.0.0.1]:43663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jF1Pr-0002IP-7b for submit@debbugs.gnu.org; Thu, 19 Mar 2020 16:05:19 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:60813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jF1Pn-0002I7-F1 for 34276@debbugs.gnu.org; Thu, 19 Mar 2020 16:05:18 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: brice@waegenei.re) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id E7B0DE0007 for <34276@debbugs.gnu.org>; Thu, 19 Mar 2020 20:05:08 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 19 Mar 2020 20:05:08 +0000 From: Brice Waegeneire To: 34276@debbugs.gnu.org Subject: =?UTF-8?Q?Re=3A_bug=2334276=3A_=E2=80=98guix_system_disk-im_age?= =?UTF-8?Q?=E2=80=99_successfully_builds_a_bad_image?= Message-ID: <7a36cb1fc7c68f5d63a324df49170cdc@waegenei.re> X-Sender: brice@waegenei.re User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34276 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Ludovic, > I investigated a bit. I managed to get our code to cause a kernel > panic > upon failure (patch below). However I fail to turn that guest kernel > panic into a different QEMU exit code. > > I tried to use the “pvpanic” paravirtualized device (the ‘pvpanic.ko’ > module in the guest, and “-device pvpanic” on the QEMU command line), > but unfortunately that thing is almost undocumented and I can’t get it > to turn the panic into a non-zero exit code, nor do I know if it’s > possible. > > Thoughts anyone? I looked a little into it and I have found how to use pvpanic. Unfortunately it's not as straight forward as getting a non-zero exit code form qemu. When pvpanic is loaded in a VṂ, as you did with “-device pvpanic”, generate events[0] on the QMP interface when a crash happen and qemu either shutdown or pause when using --no-shutdown[1]. (gnu build marionette) which use the “-monitor” interface could be recycled to use “-qmp” a machine interface using JSON. Following is log of a QMP session where the guest panicked[2]: --8<---------------cut here---------------start------------->8--- { "QMP": { "version": { "qemu": { "micro": 0, "minor": 2, "major": 4 }, "package": "" }, "capabilities": [ "oob" ] } } { "execute": "qmp_capabilities" } { "return": { } } { "timestamp": { "seconds": 1584645026, "microseconds": 936550 }, "event": "GUEST_PANICKED", "data": { "action": "pause" } } { "timestamp": { "seconds": 1584645026, "microseconds": 936675 }, "event": "GUEST_PANICKED", "data": { "action": "poweroff" } } { "timestamp": { "seconds": 1584645026, "microseconds": 936776 }, "event": "SHUTDOWN", "data": { "guest": true, "reason": "guest-panic" } } --8<---------------cut here---------------end--------------->8--- [0]: https://github.com/qemu/qemu/blob/9ced5c7c20cb16dff0c2fa3242c3ee96b68cec2a/qapi/run-state.json#L339-L355 [1]: https://github.com/qemu/qemu/blob/4dd6517e369828171290b65e11f6a45aeeed15af/softmmu/vl.c#L1423-L1427 [2]: https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/interop/qmp-intro.txt;hb=HEAD Brice.