From patchwork Tue Jan 2 16:04:50 2024 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: 759368 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6113131wrw; Tue, 2 Jan 2024 08:06:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFkJ1cshHpWFEXCn1oCmpyBsqhEH3l7FUlimIOvUz4k+PNuEIE4IASW0hkqbuP+Oh9TAti X-Received: by 2002:a05:620a:11a4:b0:781:2b9e:eda8 with SMTP id c4-20020a05620a11a400b007812b9eeda8mr25012947qkk.1.1704211589084; Tue, 02 Jan 2024 08:06:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704211589; cv=none; d=google.com; s=arc-20160816; b=Ln/2a3AAcunTSA3FnEAPi5Rv0g0fgzFbLbgPmbn/DZYaB1vPkWvEJpyrBc+SOJJUVI 8KX2vgVGC9Eua5dDJLk4CshYbejYuslthJbh9mUHzn6OYSMFCMZ95a3OkbTVMVHlKVPk HEJ0axF3NIMcEYd29jJx85nJnAgtYTb7UnEGMhgYOFMhQgijTfa10T6har94F/4EbeLM gcd4StHbWlKGsO+lCNpRvbSB6TXh7CeT+VB0FsqDt8Cobf0xQ0CicnkBfNoxEm0E/xaK NuVJheYNx9h1h3XCi78JioFZX7JLkraRyH8HCjHLavWhKqY/RpqyeZsko/wlbFinIxbI 7BRQ== 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=TVl3cttQKDPPU7GqDBLczNEA1v4uR7uW39llQJlVRbI=; fh=Fbl4rt7vNadFyu+mhE5sPZ2m5GJmVL0UTbP+h3uuTlY=; b=auxpIklJsZWQlUJu60Fv/WY3PHUuUXfnwpdnjR6BRDp5A1V0MacpdC5WeEPKQGgDEa n/VCwl1lzr1+bM+7qjoedROzdiDb9wDnaxTD4fuPVnGUZJGfzJKauu7/fg7yGbADtjtY otH0X4rFgXSh6y2BkFp4mTzbvO3lnCWeL0PmipuOmptviiVM5I/u2RAKMMm23LKU/y5R rabum/IntotelKYuGdRCAGiFvApxSOulhYt4vJD9Nxkmp+1e5sCwF+lcSJSvU+OQr3Gz B1LL+BL2EZC1e1L66N7Xpc39+fzuaCKI7Cl8wlA638Iq1wxR4nSyfqEktadxLyJF/y5M bzfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CLftFzGq; 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 u18-20020a05620a431200b00781bea73c70si5168076qko.669.2024.01.02.08.06.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jan 2024 08:06:29 -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=CLftFzGq; 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 1rKhGh-0006Hs-P3; Tue, 02 Jan 2024 11:05:27 -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 1rKhGQ-0006Dn-J9 for qemu-devel@nongnu.org; Tue, 02 Jan 2024 11:05:12 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rKhGN-0002bo-1p for qemu-devel@nongnu.org; Tue, 02 Jan 2024 11:05:09 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40d2e56f3a6so54593985e9.1 for ; Tue, 02 Jan 2024 08:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704211504; x=1704816304; darn=nongnu.org; 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=TVl3cttQKDPPU7GqDBLczNEA1v4uR7uW39llQJlVRbI=; b=CLftFzGqukIDPysFORoEwcodOyqQQn9lZIVx9iNBxx3upXjybY0KP+wKv0KfLAWI3f v4lI3/UqSuV2N+DeZ6UNcAz7rbJRyI0rMf5Lf5FburOMKHHR4c3w/kbAboRh7hMaXfMd mMcjG0xI1O86vX1DmItVdP5YyhJNm1pxDXzs7NI7v2yM6zeQJmlwqRU6CDqxtaxABDFt daLtTdvRDrjRknzVmr1yRSpg1WfrRfmALKidL2FzLq9y/ZawuwySOA0peBRaqh7iqfm1 2ECxgPxtEzjAhL6CeYcirmoTz1tNYIb80+2wCKVbr216uVPPJ+XHPPAF09byCxiGqPvO 0t4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704211504; x=1704816304; 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=TVl3cttQKDPPU7GqDBLczNEA1v4uR7uW39llQJlVRbI=; b=TaQHTmoJU4s+GFEdfNHQnAjunMfwK8Wukrln6m8F3/GEQeJd946d0BtmErTbA8hgIL PmVxyuybyn1rFunGBjafV08Vqj9hS3C3UFBGmm5ZHvtoYyPmgcxxZ4Gf0yrfICQkl8ra Tj3X0i6gk6RJepeztwNLtGT7Zad5F0Iws1AA+TZlDwsmA+VBotYhuG7z68EkHxtpaRsR hTGkw6+poL7ER1pcQdl/HRI7QG8Tex0ryoqC1+lop0+mO7mBCbc2/Bcmya3aqQZdwuZR xXSfB7CCr6OE9Mc+nqUIjUQRIH8utL/NUjwMk9bKL2FU2HqZje6xNjrTAJfi6L3siq6r d/EA== X-Gm-Message-State: AOJu0YwUgPE43rT3zS9WhMmKoVWoMQAi7tY0yH1biBG7VCzyIMdm5Cpm 5hRY24uCS+BmTrTmp5VK7Y7vyDj9/toS0kKkRSryPxIPfAQ= X-Received: by 2002:a05:600c:4713:b0:40d:734e:665d with SMTP id v19-20020a05600c471300b0040d734e665dmr3139136wmo.41.1704211504678; Tue, 02 Jan 2024 08:05:04 -0800 (PST) Received: from m1x-phil.lan (sal63-h02-176-184-16-71.dsl.sta.abo.bbox.fr. [176.184.16.71]) by smtp.gmail.com with ESMTPSA id j16-20020a05600c191000b0040c11fbe581sm45314295wmq.27.2024.01.02.08.05.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Jan 2024 08:05:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Eric Blake , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-arm@nongnu.org, Luc Michel , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Mark Cave-Ayland , Eduardo Habkost , Frederic Konrad , Markus Armbruster , Paolo Bonzini , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 1/5] qdev-properties: Add qdev_property_del_static() Date: Tue, 2 Jan 2024 17:04:50 +0100 Message-ID: <20240102160455.68612-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240102160455.68612-1-philmd@linaro.org> References: <20240102160455.68612-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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, T_SCC_BODY_TEXT_LINE=-0.01 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 We can add properties with qdev_property_add_static(). Add qdev_property_del_static() to delete them. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-properties.h | 2 ++ hw/core/qdev-properties.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 09aa04ca1e..0e1930177e 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -225,6 +225,8 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj, */ void qdev_property_add_static(DeviceState *dev, Property *prop); +void qdev_property_del_static(DeviceState *dev, Property *prop); + /** * qdev_alias_all_properties: Create aliases on source for all target properties * @target: Device which has properties to be aliased diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 7d6fa726fd..0c17a5de82 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -994,6 +994,13 @@ void qdev_property_add_static(DeviceState *dev, Property *prop) } } +void qdev_property_del_static(DeviceState *dev, Property *prop) +{ + Object *obj = OBJECT(dev); + + object_property_del(obj, prop->name); +} + static void qdev_class_add_property(DeviceClass *klass, const char *name, Property *prop) {