From nobody Mon Feb 9 04:14:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1571920527; cv=none; d=zoho.com; s=zohoarc; b=a8wyB9idQefY3rWCkdN4KJrgpWfrxTyqnhfxqhHU+BalAnPhLxynXSobGXsNg8SsyJf+5GZUI4hIq89HnJnDfjD4er6fRhnje2WA3BZqmko/x1ZmH3DtbKVz5odGzvQCoC7OmClmZISoFbVjacFO/wineJrcZ2mtwhhP6vw4UKc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571920527; 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=BygR34LySj0l7ppg21rNNPWEo8jhNWcQwBrvYuZcl2U=; b=hnRAm5pztoeMAraeYq2xLTzKeJqcS+oGq0ADdG48Ji3XY8ugbrILRCSzuLtMiAg/gxcICMxdFSjF8ivaVO/16fsFkzrdT20m8dYJzO3eYKBToz5pZpWsRUQAgZieqPPPxmjakwZla39+KI/lZWTDWvVi4Wiz4WaHFoB1291VlSI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.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 1571920527700439.4668539353031; Thu, 24 Oct 2019 05:35:27 -0700 (PDT) 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-102-nUnRK-0nMHCUfXSsbGNUAA-1; Thu, 24 Oct 2019 08:35:24 -0400 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 08164476; Thu, 24 Oct 2019 12:35:18 +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 CB06E5D712; Thu, 24 Oct 2019 12:35:17 +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 6F5361803B4C; Thu, 24 Oct 2019 12:35:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9OCZ9L2004500 for ; Thu, 24 Oct 2019 08:35:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id C63165DC1E; Thu, 24 Oct 2019 12:35:09 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.118.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 944645D9CA; Thu, 24 Oct 2019 12:35:09 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 317951130348; Thu, 24 Oct 2019 14:34:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571920526; 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=BygR34LySj0l7ppg21rNNPWEo8jhNWcQwBrvYuZcl2U=; b=fuxa3ZM6QZ0iLN7GkLhJMmkdS4dks+j+Zo3zwB6yq6M9GNMfV1V2JDAreKya1QskgqWQos XcrvGNRCteyDlthc9uD4rKnyw6go0ENpTkiymQbCnqNkgs3HHQjZ2u5WA5oqLA4RFnNrw6 /wWoAFqaE3mCEbG8yelbBsFMaOJmYHI= From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 24 Oct 2019 14:34:56 +0200 Message-Id: <20191024123458.13505-18-armbru@redhat.com> In-Reply-To: <20191024123458.13505-1-armbru@redhat.com> References: <20191024123458.13505-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 17/19] qapi: Implement -compat deprecated-input=crash for commands 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-MC-Unique: nUnRK-0nMHCUfXSsbGNUAA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This policy calls abort() when a deprecated command is received. Crashing should reliably[*] fail existing integration tests with very little additional work (just pass the option). [*] Bugs in tests can conceivably mask even crashes, but that seems unlikely. Signed-off-by: Markus Armbruster --- qapi/common.json | 4 ++-- qapi/qmp-dispatch.c | 1 + qemu-options.hx | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qapi/common.json b/qapi/common.json index 3e9d12c90f..06e54642bb 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -152,14 +152,14 @@ # # @accept: Accept silently # @reject: Reject with an error -# TODO @crash: abort() the process +# @crash: abort() the process # # FIXME Guidance on intended use. # # Since: 4.2 ## { 'enum': 'CompatPolicyInput', - 'data': [ 'accept', 'reject' ] } + 'data': [ 'accept', 'reject', 'crash' ] } =20 ## # @CompatPolicyOutput: diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index b079db85d2..6436417844 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/qemu-options.hx b/qemu-options.hx index f107a57c81..3a740ea7b1 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3320,7 +3320,7 @@ STEXI ETEXI =20 DEF("compat", HAS_ARG, QEMU_OPTION_compat, - "-compat [deprecated-input=3Daccept|reject][,deprecated-output=3Daccep= t]\n" + "-compat [deprecated-input=3Daccept|reject|crash][,deprecated-output= =3Daccept]\n" " Policy for handling deprecated management interfaces\= n", QEMU_ARCH_ALL) STEXI @@ -3333,6 +3333,8 @@ Set policy for handling deprecated management interfa= ces: Accept deprecated commands @item deprecated-input=3Dreject Reject deprecated commands +@item deprecated-input=3Dcrash +Crash on deprecated command @item deprecated-output=3Daccept (default) Emit deprecated events @end table --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list