From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B07EC432C0 for ; Wed, 20 Nov 2019 16:00:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4297D20714 for ; Wed, 20 Nov 2019 16:00:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JbumeeiI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4297D20714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXSP2-0003B4-LE for qemu-devel@archiver.kernel.org; Wed, 20 Nov 2019 11:00:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35199) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXRxa-0007XL-LJ for qemu-devel@nongnu.org; Wed, 20 Nov 2019 10:32:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXRxZ-0001j6-DF for qemu-devel@nongnu.org; Wed, 20 Nov 2019 10:32:02 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:44805 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iXRxZ-0001ix-9G for qemu-devel@nongnu.org; Wed, 20 Nov 2019 10:32:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574263920; h=from:from: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; bh=SlnrVNfRLNjcjw1Xl9TECTlnAVbkO5jdhxvztSBIVuY=; b=JbumeeiIusZqg4BlhCJvl1+4H6jZskn7VkKd30DXVHNObzZNkRGFRT4N7A8NpFBbrNhRfI yed9H76GtTxL+0EHnHsZ4GRfFQ5shHY7MOGXRWQXPNdTVMxC7jIZAqqLUDT/SrYn5OnTek Nr75S4atczH087VPY3+Rp5HGTD+z1Ew= 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-122-VHpoeeayMU6Zs9w9koS5Lw-1; Wed, 20 Nov 2019 10:31:58 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id F249C8024CC; Wed, 20 Nov 2019 15:31:57 +0000 (UTC) Received: from localhost (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE7C568882; Wed, 20 Nov 2019 15:31:51 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Subject: [PATCH v4 36/37] qdev: remove QDEV_PROP_PTR Date: Wed, 20 Nov 2019 19:24:41 +0400 Message-Id: <20191120152442.26657-37-marcandre.lureau@redhat.com> In-Reply-To: <20191120152442.26657-1-marcandre.lureau@redhat.com> References: <20191120152442.26657-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: VHpoeeayMU6Zs9w9koS5Lw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" No longer used in the tree. The comment about user_creatable is still quite relevant, but there is already a similar comment in qdev-core.h. Reviewed-by: Peter Maydell Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 18 ------------------ include/hw/qdev-properties.h | 22 ---------------------- 2 files changed, 40 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index be4cb01f0b..6271169d7d 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -469,13 +469,6 @@ const PropertyInfo qdev_prop_string =3D { .set =3D set_string, }; =20 -/* --- pointer --- */ - -/* Not a proper property, just for dirty hacks. TODO Remove it! */ -const PropertyInfo qdev_prop_ptr =3D { - .name =3D "ptr", -}; - /* --- mac address --- */ =20 /* @@ -1133,17 +1126,6 @@ void qdev_prop_set_enum(DeviceState *dev, const char= *name, int value) name, &error_abort); } =20 -void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value) -{ - Property *prop; - void **ptr; - - prop =3D qdev_prop_find(dev, name); - assert(prop && prop->info =3D=3D &qdev_prop_ptr); - ptr =3D qdev_get_prop_ptr(dev, prop); - *ptr =3D value; -} - static GPtrArray *global_props(void) { static GPtrArray *gp; diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 5bba033b7b..a708c3870b 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -17,7 +17,6 @@ extern const PropertyInfo qdev_prop_size; extern const PropertyInfo qdev_prop_string; extern const PropertyInfo qdev_prop_chr; extern const PropertyInfo qdev_prop_tpm; -extern const PropertyInfo qdev_prop_ptr; extern const PropertyInfo qdev_prop_macaddr; extern const PropertyInfo qdev_prop_on_off_auto; extern const PropertyInfo qdev_prop_losttickpolicy; @@ -168,25 +167,6 @@ extern const PropertyInfo qdev_prop_pcie_link_width; #define DEFINE_PROP_PCI_DEVFN(_n, _s, _f, _d) \ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_pci_devfn, int32_t) =20 -/* - * Please avoid pointer properties. If you must use them, you must - * cover them in their device's class init function as follows: - * - * - If the property must be set, the device cannot be used with - * device_add, so add code like this: - * |* Reason: pointer property "NAME-OF-YOUR-PROP" *| - * DeviceClass *dc =3D DEVICE_CLASS(class); - * dc->user_creatable =3D false; - * - * - If the property may safely remain null, document it like this: - * |* - * * Note: pointer property "interrupt_vector" may remain null, thus - * * no need for dc->user_creatable =3D false; - * *| - */ -#define DEFINE_PROP_PTR(_n, _s, _f) \ - DEFINE_PROP(_n, _s, _f, qdev_prop_ptr, void*) - #define DEFINE_PROP_CHR(_n, _s, _f) \ DEFINE_PROP(_n, _s, _f, qdev_prop_chr, CharBackend) #define DEFINE_PROP_STRING(_n, _s, _f) \ @@ -259,8 +239,6 @@ void qdev_prop_set_drive(DeviceState *dev, const char *= name, void qdev_prop_set_macaddr(DeviceState *dev, const char *name, const uint8_t *value); void qdev_prop_set_enum(DeviceState *dev, const char *name, int value); -/* FIXME: Remove opaque pointer properties. */ -void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value); =20 void qdev_prop_register_global(GlobalProperty *prop); int qdev_prop_check_globals(void); --=20 2.24.0