From nobody Thu Nov 13 23:39:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583253369; cv=none; d=zohomail.com; s=zohoarc; b=l07nzC62x+gpFrnHlOKegyafswj4+7ky1ofYxbAxu8eOzpt84Mq5cRZ/32bfSMujGlmuuMMHdDZ45+kwc3iRbWKKrtf5JHzw0af4HFcKZZzNVxsJts3iPmd9TsN7YAhTu8z/mjcQPvfPN9MB9PK7gvV6xDchnFrlDC7POTK0nps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583253369; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Lv+Y3uORPyKTvnxkqiYkWuE9C0PyzcV1+KlOv2igoQI=; b=XglN0iZ55mVrvvy4WzwH+vMo1ZPaaFL/iQd2EARViGsS+VMvUh0yvYr1/RBHMnt4DlM8LmG5t9TEEtVkYfd8UOfQEc8RmTgbacQyoh3c/yvkktNH6Wa+kDNae26/Hb7fua1TJqcY0pEaOF7Hx9+FZmDonxdPFmpczcRU3oK8NfA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1583253369293180.41348299835784; Tue, 3 Mar 2020 08:36:09 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-290-TfWaqoVzOYumoI8LnIGosA-1; Tue, 03 Mar 2020 11:36:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B025800D4E; Tue, 3 Mar 2020 16:35:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E061773886; Tue, 3 Mar 2020 16:35:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 915841803C40; Tue, 3 Mar 2020 16:35:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 023GZH7q001339 for ; Tue, 3 Mar 2020 11:35:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id B4AFC101D482; Tue, 3 Mar 2020 16:35:17 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-129.ams2.redhat.com [10.36.116.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B99B710027B1; Tue, 3 Mar 2020 16:35:15 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 201361130356; Tue, 3 Mar 2020 17:35:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583253368; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Lv+Y3uORPyKTvnxkqiYkWuE9C0PyzcV1+KlOv2igoQI=; b=PtgS+Xjr7APOC9jMpGqLBpogZGHUeDdSpSLWEhlDtQibj30btzd1V5wnnU+NCtUNZkkYBn /bi9FHH8hEE8XTvcEsSyQNJDUwtBat2HnXqpPXCIDvERT144/1OUa7WfUp+PdWqCSx+ld+ MbkjQ7LwuwRTXx7r1kHuxv7+3KokXEY= X-MC-Unique: TfWaqoVzOYumoI8LnIGosA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 30/30] qapi: New -compat deprecated-input=crash Date: Tue, 3 Mar 2020 17:35:05 +0100 Message-Id: <20200303163505.32041-31-armbru@redhat.com> In-Reply-To: <20200303163505.32041-1-armbru@redhat.com> References: <20200303163505.32041-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Policy "crash" calls abort() when deprecated input is received. Bugs in integration tests may mask the error from policy "reject". Provide a larger hammer: crash outright. Masking that seems unlikely. Signed-off-by: Markus Armbruster --- qapi/compat.json | 3 ++- qapi/qmp-dispatch.c | 1 + qapi/qobject-input-visitor.c | 1 + qemu-options.hx | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/qapi/compat.json b/qapi/compat.json index fd6f8e932c..ec24567639 100644 --- a/qapi/compat.json +++ b/qapi/compat.json @@ -11,11 +11,12 @@ # # @accept: Accept silently # @reject: Reject with an error +# @crash: abort() the process # # Since: 5.0 ## { 'enum': 'CompatPolicyInput', - 'data': [ 'accept', 'reject' ] } + 'data': [ 'accept', 'reject', 'crash' ] } =20 ## # @CompatPolicyOutput: diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 516ee9b0b7..2c8fac02cd 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -141,6 +141,7 @@ QDict *qmp_dispatch(QmpCommandList *cmds, QObject *requ= est, "Deprecated command %s disabled by policy", command); goto out; + case COMPAT_POLICY_INPUT_CRASH: default: abort(); } diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index 6ea93f5a7a..a74c901be9 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -654,6 +654,7 @@ static bool qobject_input_deprecated(Visitor *v, const = char *name, error_setg(errp, "Deprecated parameter '%s' disabled by policy", name); return false; + case COMPAT_POLICY_INPUT_CRASH: default: abort(); } diff --git a/qemu-options.hx b/qemu-options.hx index d02d6bfc15..7e49f778f4 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3361,7 +3361,7 @@ STEXI ETEXI =20 DEF("compat", HAS_ARG, QEMU_OPTION_compat, - "-compat [deprecated-input=3Daccept|reject][,deprecated-output=3Daccep= t|hide]\n" + "-compat [deprecated-input=3Daccept|reject|crash][,deprecated-output= =3Daccept|hide]\n" " Policy for handling deprecated management interfaces\= n", QEMU_ARCH_ALL) STEXI @@ -3373,6 +3373,8 @@ Set policy for handling deprecated management interfa= ces (experimental): Accept deprecated commands and arguments @item deprecated-input=3Dreject Reject deprecated commands and arguments +@item deprecated-input=3Dcrash +Crash on deprecated command @item deprecated-output=3Daccept (default) Emit deprecated command results and events @item deprecated-output=3Dhide --=20 2.21.1