From patchwork Mon Jan 9 22:54:15 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: 640705 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2398565pvb; Mon, 9 Jan 2023 14:55:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXsMSXg7Rl902CNo1yLsmyIXHVHBGM3nzJOKOoTDz/z6UqESzHDKKhnwfeZkwZRWH62K0Aqz X-Received: by 2002:ac8:7190:0:b0:3a9:7d1a:ff0c with SMTP id w16-20020ac87190000000b003a97d1aff0cmr87108080qto.62.1673304909770; Mon, 09 Jan 2023 14:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673304909; cv=none; d=google.com; s=arc-20160816; b=jZZzzEGHmhUCS/Vf/cnwJc69UcR8NZM7LtQMFvCchaIjpm2/6ilOrkLWeBT6bsQJUi rv3Ra3Ui4i8vHdxALH6JVcRwTAbFsyNl4Hx/3suNsYpfocnxAsmked7oA16yZYNNifA+ ij69pwcBFu8g5n0Xqlgx97h2KlsK0B+kH5I60eUrRS3sMCxbvsO9hMq0OYsL3iNaKN7y C6Aqyx2AfzuE0LILrxnijbXDzcDKXfLlAoCI7yQwwLt+q9Awzxo6sNUvX5zwbIblokR5 0wc8kzpZa4N/Lp79CIYjLbklmykmVxmylx63eh4hOz1sJZEH+KgSD17SGIJ7JIo+g6PN g1BQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=qSermBP5/xXhGWhvny4/gfNcgaMNo5optvZ6TnwS3lw=; b=X3nlOJHIcnCCPdVf7qXaKRYKbbHSo98Fq/DkFRcYQ66IEbNJImy7SELyJz8RdaihZi L+EDrNkpWECXp2jk/gMueOs0Ha2+rnpwMmoFft8TNyCXFQS50IwDgBfHuXTJPbvbWcxJ NbeH1dfRfwFp8C+GvR5TrKJGmMtHGIrnW/GW3bnEOzhME4IvzU24gZB8rBD37Sl75FKg 1aQmX1SNh5470j7NrDgFYvMCKDWeLrNfcxscrfX5dN367dwWfoqTJ1mIX7UOv8Fguxfc fJBIkxxWFXLN+Zu/YMs2TqrRBfWIkc4tntjg6Bdxl5EQNRjxDtDwMDmjbeHsXq375THr xtLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZubaV9u/"; 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 de4-20020a05620a370400b006fbba0f5a48si5392949qkb.3.2023.01.09.14.55.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 14:55:09 -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="ZubaV9u/"; 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 1pF12E-0004gt-G5; Mon, 09 Jan 2023 17:54:30 -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 1pF12A-0004cP-AH for qemu-devel@nongnu.org; Mon, 09 Jan 2023 17:54:26 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pF128-0007i5-JL for qemu-devel@nongnu.org; Mon, 09 Jan 2023 17:54:26 -0500 Received: by mail-wm1-x332.google.com with SMTP id g10so7513350wmo.1 for ; Mon, 09 Jan 2023 14:54:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qSermBP5/xXhGWhvny4/gfNcgaMNo5optvZ6TnwS3lw=; b=ZubaV9u/NuFYbN6RwQ2kYcGCYlv99oUhzK//4N6LEFAPMrH09Y9IK0NfecBDdleHnn G0ZpHL4vkW0TRTjBD1ag4TbPPphoEK2LRIMjZpnXUmKzvJkViUUAUBZMj4IAqoS7Z5dO NsK9lfjMjOsBxVhcpZW3XlBLg5OHOM2lxe6ULTUISw8KU9deCu0qYK5dcz8eCbRRY3Mn eKLOY28yMKJqBDOkQsiqTEZGZamZyYtFkWUBEaIXp/0Kf7KRYmGEcWHfyF8weGgPbs8W zdbYMRMFgl93g2vJxf18uXJXnToXZ6KHOhSX2y6QaGpO1FJdn491MkVz3Cc2cD2cmddW 3X/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qSermBP5/xXhGWhvny4/gfNcgaMNo5optvZ6TnwS3lw=; b=KEcEaak+0iNPv5s7gqXRUgpVluhJMjKMWRAPJJQveeiNpzs325v1XT6WxVkdkQjbMl jTrksqQwxCIKcexbiRpEzzqTadE05zdLUGo6TpZ1VdX4yGM/MAsQX3UvwJBYFj8Rg4SX 67KusrCa72pqsrJoGM4plbTW4LdGZ2YLP4itBes1HO6j/6FeXx6j+b2I0s3XizK5F18L BPCYnd+AjWQih3GAql79p4gvp72Ocd/w4KChMdKh0YsNLjtfQK33Zx1NuCZFFU0U6sx0 t8h5fKqfxWLted/qzI5wOUTb7lumXbjleunmfknSI9UyZUzdjI5uDkr647y4hUmSXnuh iHcg== X-Gm-Message-State: AFqh2kpY5zUBdCuL5vSV/5q1xC/9YZv6aNLtx0e4giq2RCfkD0PCfNEJ SpYnHwbRRs37dc+NzENoFyFJfQ9fJPZjRZVT X-Received: by 2002:a05:600c:1c21:b0:3d2:2faf:e54b with SMTP id j33-20020a05600c1c2100b003d22fafe54bmr47383950wms.6.1673304862158; Mon, 09 Jan 2023 14:54:22 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id f8-20020a0560001b0800b002423edd7e50sm9553651wrz.32.2023.01.09.14.54.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 14:54:21 -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 0/4] qom: Introduce object_class_property_deprecate() Date: Mon, 9 Jan 2023 23:54:15 +0100 Message-Id: <20230109225419.22621-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Hi, There will always be a need to deprecate things. Here I'm tackling the QOM (class) properties, since they can be set from some CLI options (-object -device -global ...). As an experiment, we add object_class_property_deprecate() to register a class property as deprecated (since some version), then we deprecate the TYPE_PFLASH_CFI02 'width' property, and finally as a bonus we emit a warning when the deprecation period is over, as a reminder. (For that we introduce few 'versions' helpers). Output example: $ qemu-system-arm -M musicpal,accel=qtest -S \ -drive if=pflash,driver=null-co,read-zeroes=on,size=8M \ -global driver=cfi.pflash02,property=width,value=2 qemu-system-arm: warning: Property 'cfi.pflash02.width' is deprecated (renamed as 'cfi.pflash02.device-width'). $ qemu-system-arm -M musicpal,accel=qtest -S \ -drive if=pflash,driver=null-co,read-zeroes=on,size=8M \ -global driver=cfi.pflash02,property=device-width,value=2 qemu-system-arm: warning: Property 'cfi.pflash02.width' has been deprecated in release v8.0 and can be removed. Thought? Regards, Phil. [earlier inspiration: https://lore.kernel.org/qemu-devel/Y7wlnqwU+/auE0Jj@redhat.com/] Philippe Mathieu-Daudé (4): qom: Introduce object_class_property_deprecate() hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width' util: Introduce helpers to compare QEMU versions qom: Warn when deprecated class property can be removed hw/block/pflash_cfi02.c | 8 +++++++- include/qemu/qemu-version.h | 36 ++++++++++++++++++++++++++++++++++++ include/qom/object.h | 17 +++++++++++++++++ qom/object.c | 30 ++++++++++++++++++++++++++++++ util/meson.build | 1 + util/qemu-version.c | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 include/qemu/qemu-version.h create mode 100644 util/qemu-version.c