From patchwork Mon Jan 9 22:54:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 640706 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2398629pvb; Mon, 9 Jan 2023 14:55:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXvs3KaooJpHbP3jgOSGvFpRJE1u8BxWKNKZAjRYfiTHmN6pr7zHUNBOmk+MeUAyBLP1SWhW X-Received: by 2002:ac8:5fcd:0:b0:3ae:64e0:58ef with SMTP id k13-20020ac85fcd000000b003ae64e058efmr5366236qta.13.1673304927489; Mon, 09 Jan 2023 14:55:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673304927; cv=none; d=google.com; s=arc-20160816; b=lBtcLMrTilXYbQDnFdQkBgpxXeAvtUC1NV5+Ri/skcD7fqCztZHWimscGvEVEZJHHv CAP/6BMYRjOqGMCAfkYLTfC1G/CYfFl2vfQx4PhFMUWd7Om6CkpsoHj72YZfNEfZeH6N L2Px9iBCllDtQWc837xJWk9hLlTqLF4Lrdwx8jRf9tMN9roqKzX4EHuCizh17B+sg0a/ Fap2TRTd04E6JX5T5E0oRpWOw5ebNvxM5sQcb2vmy+DG/2W6vv5+VFqjtgoKb3E6eQxk T+Q1u1PtABkxi5V5ynenOW8NBmyQVkAyYlUdQiC4FE/ZflxdgjyCBwW7EbjKamkGqQn+ FT5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xA2zJhQFDWndGaehXTKSbGgxfQUNaxn1ECLWbGBrK7I=; b=VqzOoz2jsyKEYbDaf/w0apZIu06h7soC25KlXU6QiMO+/E8M69lrRMUwd5pMX80/og kUrbDVC+jE/ripASJPC8dfVpyeQ0M/3+m1/1GZiHbGXaGJVa93tmdycqQdHCkiqYbwoO B0wZVTT+3A1Gccl4oVVbJG0XYj9RvB2DGIw3HIHI3hlQ6edjUtWf4FxeOSPi1OclCijH uOS3cFxjuGj10bdCS9nD/3dPyKAAaec51gA4O73JPd8BU/xzPS+zbB5iZ8WLzMr3vXia 1t3BsLY90L3O4QlF2EKN8bVP94pCB3wmPMY6NtzLHoNKWEGpT8k3FtCZtS43EppFPW/L BUOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZiWawKgd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c84-20020ae9ed57000000b006fb05de4731si4855065qkg.722.2023.01.09.14.55.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 14:55:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZiWawKgd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pF12W-0005Is-H5; Mon, 09 Jan 2023 17:54:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pF12U-0005Eh-Lb for qemu-devel@nongnu.org; Mon, 09 Jan 2023 17:54:46 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pF12S-0007j9-7h for qemu-devel@nongnu.org; Mon, 09 Jan 2023 17:54:46 -0500 Received: by mail-wm1-x32f.google.com with SMTP id g19-20020a05600c4ed300b003d9eb1dbc0aso5509072wmq.3 for ; Mon, 09 Jan 2023 14:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xA2zJhQFDWndGaehXTKSbGgxfQUNaxn1ECLWbGBrK7I=; b=ZiWawKgdap3V5zfR9jF6GYBvUIOaaNpcUKjMu0EgoEgehQ7RnKMffxlDsQHXnIuJEt Aau+SlfpAipUv5lqgt+GFGfogYu3dYt8IkjLseUWaWJXhfpHZaMVQcGAlgvb4BMszdfl T1eDCNDUWq/yH1YFc+c14ypDaPyxgRYI3Dk2G8TOPoGobQQb3v6L2/vhyVv3v1vftWhj vVRoXEklPmz8MN7UiYgZgC/MFkzCKv6Erz061b0BwZvxf6t9YOp8xfQkQnukiIyfuORK brvG7uD46HxxmgN/Re+E0jwL35sXxrejEoU2Bb5f+GaoBZo96wl0nDKz+eoSvW6Qz6ha /HYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xA2zJhQFDWndGaehXTKSbGgxfQUNaxn1ECLWbGBrK7I=; b=rnhdtZHePjzz42dl1oz2NuUT5RSTVMJQVKXuNlfPFEUDXgdGhj3pS/nuR4TdoP1ml6 loaxmSMrUoYaeVE6XfTkchtvZh6Ce8rxme9ACdhJHSRYgoJzVTKhY3r92oXtMEUhWorh OUgaOBhhPoT5hwepqbo4LMwTKm4XxRwirKrZvq05mV+bFVYuS5ClbFuyDeo+SCF6bZ/B kT/xDjsgIcXXrBhwyZLRe3X9q0gqUm+BPMFNefQ4WR1dES8yby8m4DZUohTMjErJIctz L7m+IuBf6Pj5k6oF2k9Iih0odi/RN7C+EnkITrbkRTY9MpSkisd3tO4wS5zcVMgjm2EO kQcg== X-Gm-Message-State: AFqh2krYyGIhKlATtEs11qlindrw8H2P11HO88TqxMDjVuS9DrrYrGRi RYw0aRsYjpAy+S3yi7hN1VVtOPk4VlM9b8ZP X-Received: by 2002:a1c:4c0e:0:b0:3d9:f836:3728 with SMTP id z14-20020a1c4c0e000000b003d9f8363728mr219439wmf.11.1673304883369; Mon, 09 Jan 2023 14:54:43 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id n23-20020a05600c3b9700b003cf71b1f66csm14602830wms.0.2023.01.09.14.54.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 14:54:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost , Markus Armbruster , "Daniel P . Berrange" Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Stefan Hajnoczi , Kevin Wolf , qemu-block@nongnu.org, Paolo Bonzini , Hanna Reitz Subject: [RFC PATCH 4/4] qom: Warn when deprecated class property can be removed Date: Mon, 9 Jan 2023 23:54:19 +0100 Message-Id: <20230109225419.22621-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109225419.22621-1-philmd@linaro.org> References: <20230109225419.22621-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Per docs/system/deprecated.rst, a deprecated feature can be removed after 2 releases. Since we commit when a class property is deprecated, we can warn when the deprecation period is over. See also commit ef1f5b0a96 ("docs: clarify deprecation schedule"). Signed-off-by: Philippe Mathieu-Daudé --- qom/object.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qom/object.c b/qom/object.c index 05b97cd424..cb829f1e44 100644 --- a/qom/object.c +++ b/qom/object.c @@ -17,6 +17,7 @@ #include "qom/object_interfaces.h" #include "qemu/cutils.h" #include "qemu/memalign.h" +#include "qemu/qemu-version.h" #include "qapi/visitor.h" #include "qapi/string-input-visitor.h" #include "qapi/string-output-visitor.h" @@ -1300,6 +1301,12 @@ void object_class_property_deprecate(ObjectClass *klass, ObjectProperty *prop = object_class_property_find(klass, name); assert(prop); + if (qemu_version_delta_current(version_major, version_minor) <= 2) { + warn_report_once("Property '%s.%s' has been deprecated in release" + " v%u.%u and can be removed.", + object_class_get_name(klass), name, + version_major, version_minor); + } prop->deprecation_reason = reason; }