From patchwork Wed Dec 9 17:52:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Jimenez X-Patchwork-Id: 11962005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0462C433FE for ; Wed, 9 Dec 2020 18:09:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20A7623BAC for ; Wed, 9 Dec 2020 18:09:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20A7623BAC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kn3uJ-0002xK-VT for qemu-devel@archiver.kernel.org; Wed, 09 Dec 2020 13:09:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kn3fl-0006Ov-29 for qemu-devel@nongnu.org; Wed, 09 Dec 2020 12:54:42 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:48288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kn3fg-0003Tt-P0 for qemu-devel@nongnu.org; Wed, 09 Dec 2020 12:54:40 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0B9HnLqr181505; Wed, 9 Dec 2020 17:54:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2020-01-29; bh=WjGEr7tw0uZ0BEwqBbYh1z0U+X+RgXOG73qd0cTuwkc=; b=XEqP/D2J7752Q/0XTTodlwaEqTlcgU4qtPkNw4yL8UASrWk4cZQncVVxXUfH9vsr0QiV B+9DbEgy8N8NH7wX6HElPGmk4B/8Bg7+E5F2pLy+q7agne/UxUGBcDjM7HRE5TSbgDHU p8pw4JiGEio9ugSgTIKV4sY2OUrsw3yDTSOe4akuvVekJb/Yg9/AcvmWCOdQHdFAgGXR maTCsNF/WIxBwBLgKw/OSL7rXTce05SQcOAI3Nikb+g/mDJG2GKXzSM5KtQ6z4TORB66 oNhHjdthT9tbSZAsZNDL5KcBe8aNcnh+yJG0Zci1LVckkWQMuzyidmJ7cufGyL6loZDy 6A== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 35825m9hpj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 09 Dec 2020 17:54:35 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0B9HojYP034959; Wed, 9 Dec 2020 17:52:35 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 358kyv1nfx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Dec 2020 17:52:34 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0B9HqYqk007383; Wed, 9 Dec 2020 17:52:34 GMT Received: from ban25x6uut148.us.oracle.com (/10.153.73.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 09 Dec 2020 09:52:33 -0800 From: Alejandro Jimenez To: qemu-devel@nongnu.org Subject: [PATCH v2 0/4] Add a new -action parameter Date: Wed, 9 Dec 2020 12:52:12 -0500 Message-Id: <1607536336-24701-1-git-send-email-alejandro.j.jimenez@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9829 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012090126 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9829 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 clxscore=1015 priorityscore=1501 mlxscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012090126 Received-SPF: pass client-ip=141.146.126.78; envelope-from=alejandro.j.jimenez@oracle.com; helo=aserp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: david.edmondson@oracle.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" v2: - Replaced the individual qmp commands in patch 3/4 for a generic set-action command that takes a RunStateAction parameter, specifying an event|action pair. - Removed qmp_ prefix from X_set_action() functions in runstate-action.c *** This is a follow up to the proposal to add a "-no-panicstop" option to QEMU that would allow us to control whether the VM is paused or allowed to continue running without intervention from a management layer when a guest panic occurs. See the inital thread and replies for details: https://lore.kernel.org/qemu-devel/1601606494-1154-1-git-send-email-alejandro.j.jimenez@oracle.com/ From that discussion came a request for a generic mechanism to group options like -no-shutdown, -no-reboot, etc, that specify an action taken by QEMU in response to a guest event (reboot, shutdown, panic, and watchdog expiration are the current options). The existing options would translate to the new option, like: * -no-reboot --> "-action reboot=shutdown" * -no-shutdown --> "-action shutdown=pause" Please share any questions or comments. Regards, Alejandro Alejandro Jimenez (4): vl: Add an -action option to respond to guest events vl: Add option to avoid stopping VM upon guest panic qmp: Allow setting -action parameters on the fly qtest/pvpanic: Test panic option that allows VM to continue MAINTAINERS | 2 + include/sysemu/runstate-action.h | 16 ++++ include/sysemu/sysemu.h | 2 + qapi/run-state.json | 135 +++++++++++++++++++++++++++++ qemu-options.hx | 25 ++++++ softmmu/meson.build | 1 + softmmu/runstate-action.c | 182 +++++++++++++++++++++++++++++++++++++++ softmmu/vl.c | 44 +++++++++- tests/qtest/pvpanic-test.c | 26 +++++- 9 files changed, 428 insertions(+), 5 deletions(-) create mode 100644 include/sysemu/runstate-action.h create mode 100644 softmmu/runstate-action.c