From patchwork Tue Oct 30 11:13:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10660677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7E8814BD for ; Tue, 30 Oct 2018 11:15:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2FB82937D for ; Tue, 30 Oct 2018 11:15:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A71BD29E8D; Tue, 30 Oct 2018 11:15:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4BD6B2937D for ; Tue, 30 Oct 2018 11:15:55 +0000 (UTC) Received: from localhost ([::1]:52186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHS02-0002WK-2o for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Oct 2018 07:15:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHRyC-0000xt-JT for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHRy9-00084z-0M for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49687) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHRy8-00081P-DP; Tue, 30 Oct 2018 07:13:56 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D9B658E39; Tue, 30 Oct 2018 11:13:54 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-158.ams2.redhat.com [10.36.116.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B18F5C207; Tue, 30 Oct 2018 11:13:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6B81716444F; Tue, 30 Oct 2018 12:13:48 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:13:45 +0100 Message-Id: <20181030111348.14713-2-kraxel@redhat.com> In-Reply-To: <20181030111348.14713-1-kraxel@redhat.com> References: <20181030111348.14713-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 30 Oct 2018 11:13:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] add QemuSupportState X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S. Tsirkin" , Alexander Graf , Markus Armbruster , =?utf-8?q?Herv=C3=A9_Poussineau?= , qemu-ppc@nongnu.org, Gerd Hoffmann , Paolo Bonzini , Richard Henderson , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Indicates support state for somerhing (device, backend, subsystem, ...) in qemu. Modeled roughly after the "S:" states we have in MAINTANERS. Signed-off-by: Gerd Hoffmann --- include/qemu/support-state.h | 17 +++++++++++++++++ util/support-state.c | 23 +++++++++++++++++++++++ qapi/common.json | 16 ++++++++++++++++ util/Makefile.objs | 1 + 4 files changed, 57 insertions(+) create mode 100644 include/qemu/support-state.h create mode 100644 util/support-state.c diff --git a/include/qemu/support-state.h b/include/qemu/support-state.h new file mode 100644 index 0000000000..5fd3c83eee --- /dev/null +++ b/include/qemu/support-state.h @@ -0,0 +1,17 @@ +#ifndef QEMU_SUPPORT_STATE_H +#define QEMU_SUPPORT_STATE_H + +#include "qapi/qapi-types-common.h" + +typedef struct QemuSupportState { + SupportState state; + const char *reason; +} QemuSupportState; + +void qemu_warn_support_state(const char *type, const char *name, + QemuSupportState *state); + +bool qemu_is_deprecated(QemuSupportState *state); +bool qemu_is_obsolete(QemuSupportState *state); + +#endif /* QEMU_SUPPORT_STATE_H */ diff --git a/util/support-state.c b/util/support-state.c new file mode 100644 index 0000000000..7966fa0fc7 --- /dev/null +++ b/util/support-state.c @@ -0,0 +1,23 @@ +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qemu/support-state.h" + +void qemu_warn_support_state(const char *type, const char *name, + QemuSupportState *state) +{ + warn_report("%s %s is %s%s%s%s", type, name, + SupportState_str(state->state), + state->reason ? " (" : "", + state->reason ? state->reason : "", + state->reason ? ")" : ""); +} + +bool qemu_is_deprecated(QemuSupportState *state) +{ + return state->state == SUPPORT_STATE_DEPRECATED; +} + +bool qemu_is_obsolete(QemuSupportState *state) +{ + return state->state == SUPPORT_STATE_OBSOLETE; +} diff --git a/qapi/common.json b/qapi/common.json index 021174f04e..78176151af 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -151,3 +151,19 @@ 'ppc64', 'riscv32', 'riscv64', 's390x', 'sh4', 'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32', 'x86_64', 'xtensa', 'xtensaeb' ] } + +## +# @SupportState: +# +# Indicate Support level of qemu devices, backends, subsystems, ... +# +# Since: 3.2 +## +{ 'enum': 'SupportState', + 'data': [ 'unknown', + 'supported', + 'maintained', + 'odd-fixes', + 'orphan', + 'obsolete', + 'deprecated' ] } diff --git a/util/Makefile.objs b/util/Makefile.objs index 0820923c18..6e5f8faf82 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -50,5 +50,6 @@ util-obj-y += range.o util-obj-y += stats64.o util-obj-y += systemd.o util-obj-y += iova-tree.o +util-obj-y += support-state.o util-obj-$(CONFIG_LINUX) += vfio-helpers.o util-obj-$(CONFIG_OPENGL) += drm.o