From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120614; cv=none; d=zohomail.com; s=zohoarc; b=drmVFeOXGByxXChHltv400Z9w2KQrKE71UDFJUwLJSVFXqxBJXeYu9cHgC3kzSIdwM+Lm3jvu2pk8nCnIaIBpexg/ExYOj6evj1biSCW5+cUa9L5cJ2RhGnuPWKSuFhuo9ES1AfLfJ7uoleEFTbjGRkLz9BMEqLKE8/bCSizLwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120614; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=si64ReTKrg/sjpMGmS8m+eTbdwuwB+8fMpCEA5/ywY0=; b=JAb66sbXK4alGc2yC6VFRs8n8tHbOlE08k0nHaNM2l2hWwti5CuzeIswINVsJlx4/PjrrS+veCZb0frJpJCLSMn7ASA54xLYU44uZgnheENfVzw3UDtHuCnX8PhwpICVSb6uVAVO9A+yPkquar++TcD3xp1xfJ88X8cLkTcNl0A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120614586541.581841723368; Wed, 11 Nov 2020 10:50:14 -0800 (PST) Received: from localhost ([::1]:59852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcvC9-0004RT-E0 for importer@patchew.org; Wed, 11 Nov 2020 13:50:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv2O-0000xj-GO for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:40:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv2L-0008QJ-0f for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:40:08 -0500 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-567-vP25d-rpNrKVzLNT8Xy7Rg-1; Wed, 11 Nov 2020 13:38:28 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 174D51006C84; Wed, 11 Nov 2020 18:38:27 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB91F27BD1; Wed, 11 Nov 2020 18:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605120004; 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=si64ReTKrg/sjpMGmS8m+eTbdwuwB+8fMpCEA5/ywY0=; b=VJdBNuaFksla9oaJeB4z0xakjf5VU0NAgQLI8XzmdhvRwEgXhkRUUHwJ3XbIHyakPiLxJr 8E4t3wz8NreUkdPDFP4Gu7lAld7FhixJ2R82GeJk0LMW5dHkZFdhZgOwY2MW83wcN9EjTj PFdk7cIq8miHHVDsmBWktam/zF9xSf8= X-MC-Unique: vP25d-rpNrKVzLNT8Xy7Rg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 01/12] vexpress: Register "secure" as class property Date: Wed, 11 Nov 2020 13:38:12 -0500 Message-Id: <20201111183823.283752-2-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , qemu-arm@nongnu.org, "Daniel P. Berrange" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/vexpress.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 531f3a122a..da25ce3b2c 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -755,11 +755,6 @@ static void vexpress_instance_init(Object *obj) =20 /* EL3 is enabled by default on vexpress */ vms->secure =3D true; - object_property_add_bool(obj, "secure", vexpress_get_secure, - vexpress_set_secure); - object_property_set_description(obj, "secure", - "Set on/off to enable/disable the ARM " - "Security Extensions (TrustZone)"); } =20 static void vexpress_a15_instance_init(Object *obj) @@ -796,6 +791,12 @@ static void vexpress_class_init(ObjectClass *oc, void = *data) mc->max_cpus =3D 4; mc->ignore_memory_transaction_failures =3D true; mc->default_ram_id =3D "vexpress.highmem"; + + object_class_property_add_bool(oc, "secure", vexpress_get_secure, + vexpress_set_secure); + object_class_property_set_description(oc, "secure", + "Set on/off to enable/disable th= e ARM " + "Security Extensions (TrustZone)= "); } =20 static void vexpress_a9_class_init(ObjectClass *oc, void *data) --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120303; cv=none; d=zohomail.com; s=zohoarc; b=bogs5DLEkR8RRURmKhhdCvwUPG4GA9E60pv+Xae1JemtIrW6MfODufaTOiuIb+RfvpNh2ZyxBxyg3iGYp5z/JVYEX1L7A4jrOhwyT+11pcnEik+BKXtfKjpJM+R1WXzgRAxTm+KSNg1Yv/4djS1ZPU3NvO9qF4tYQgWwiDXwJ3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120303; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HbFMJjy+ZSanPn+Sow/4EnPoUc4YBNEueLHqjzrwRBk=; b=CCquJKz194ny9j8UBHgapwnqVw6m72YVBTz7vFw17yG+7b+eeRZgNIdweWfgs3Ux3CAieBy5A5jQKZa+8L0DXtRT4gxSNwI9wn9fZB64R0zsmWl5I9pKIJ57xlOmRlRxCdIqQl79AK/r/CdXsivAyGOuy9w+p7sDtUwp3WCYOL0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120303184514.2407429023843; Wed, 11 Nov 2020 10:45:03 -0800 (PST) Received: from localhost ([::1]:45318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv77-0006hW-SR for importer@patchew.org; Wed, 11 Nov 2020 13:45:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv0t-00008p-O5 for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv0r-0007vs-V3 for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:35 -0500 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-412-d6yJAgX8M_u_HDof7KmGJA-1; Wed, 11 Nov 2020 13:38:29 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3869D801FC4; Wed, 11 Nov 2020 18:38:28 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8B0727BCD; Wed, 11 Nov 2020 18:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119913; 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=HbFMJjy+ZSanPn+Sow/4EnPoUc4YBNEueLHqjzrwRBk=; b=K2/JIbe8FX4W8K0WdNTnRGJW0uRAACVvhiWGCMKJQLCGZnwSnwiKbr4gJIJnQMxq3l/4/P mQCQhef8DWOpTq+lmol2UzyQAaWkhKGFX5qY0PzYh2DYH8sFPqv+xjOC3Z3YV4pwKUkE88 twYci5Np68NP8Nw9aAgvVzeDJAOW5JU= X-MC-Unique: d6yJAgX8M_u_HDof7KmGJA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 02/12] vexpress-a15: Register "virtualization" as class property Date: Wed, 11 Nov 2020 13:38:13 -0500 Message-Id: <20201111183823.283752-3-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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 , John Snow , qemu-arm@nongnu.org, "Daniel P. Berrange" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/vexpress.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index da25ce3b2c..c228567ce9 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -766,12 +766,6 @@ static void vexpress_a15_instance_init(Object *obj) * but can also be specifically set to on or off. */ vms->virt =3D true; - object_property_add_bool(obj, "virtualization", vexpress_get_virt, - vexpress_set_virt); - object_property_set_description(obj, "virtualization", - "Set on/off to enable/disable the ARM " - "Virtualization Extensions " - "(defaults to same as 'secure')"); } =20 static void vexpress_a9_instance_init(Object *obj) @@ -819,6 +813,14 @@ static void vexpress_a15_class_init(ObjectClass *oc, v= oid *data) mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a15"); =20 vmc->daughterboard =3D &a15_daughterboard; + + object_class_property_add_bool(oc, "virtualization", vexpress_get_virt, + vexpress_set_virt); + object_class_property_set_description(oc, "virtualization", + "Set on/off to enable/disable th= e ARM " + "Virtualization Extensions " + "(defaults to same as 'secure')"= ); + } =20 static const TypeInfo vexpress_info =3D { --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120200; cv=none; d=zohomail.com; s=zohoarc; b=Lucuc5/RRfjso510cv3B15/bXFLDx+m/XG9+lWBLElemAoyMurefnhRr5jKYf/dhhMJ6RPQp3VaZq7L/k1IMeJaIvDPiOcpYQjbek2RrPqWsLBbeyVMPMHe11GHpMtim4u1Na/A+qjge3IlOKGhxtf9sijZZY5j/gPzep/nbbSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120200; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8eJzHFzqbv5EOvpAoO6eSnBp+9AaroA5js3IWE+oEvw=; b=Hkcae1953mpeN+zXVUWrx6qa2co6Fo7UAHezQ/wQzK1JSBjMM/9P0+FO6xJAuFMeJeOmS2yLS9ijQjipATyDU6zfma/HZBEyco12xfnEdgyIxB79qbhml6sthu6h/+CkACiD6wZGcJkuq/OO6mySYm7IGNKavQpmVkz9n5JAfCw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120200765219.0040699814865; Wed, 11 Nov 2020 10:43:20 -0800 (PST) Received: from localhost ([::1]:39078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv5T-00048z-Oe for importer@patchew.org; Wed, 11 Nov 2020 13:43:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv0s-000086-OK for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv0r-0007vd-1z for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:34 -0500 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-369-UO0rHCkWNBimK33DFyX8wg-1; Wed, 11 Nov 2020 13:38:30 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4685D5F9D6 for ; Wed, 11 Nov 2020 18:38:29 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB0655DA6A; Wed, 11 Nov 2020 18:38:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119912; 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=8eJzHFzqbv5EOvpAoO6eSnBp+9AaroA5js3IWE+oEvw=; b=ST81n269ayGa7+S/ltYAwAXuVE9DcwlezDja3cQBDM6HH85YD+naX2Gcq/y+WYqvu/U9rP NCqWFoMcGvwcZsPWa9wgGz3CYQj3uNWmhRPxi7KUDmI5W8BpFYnOXWHDBNDTTMa7d55228 PzgkiAUyehqKjD+oRyjfADOq2p08bq8= X-MC-Unique: UO0rHCkWNBimK33DFyX8wg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 03/12] tmp421: Register properties as class properties Date: Wed, 11 Nov 2020 13:38:14 -0500 Message-Id: <20201111183823.283752-4-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:49:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , "Daniel P. Berrange" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost Reviewed-by: Peter Maydell --- Cc: qemu-devel@nongnu.org --- hw/misc/tmp421.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/hw/misc/tmp421.c b/hw/misc/tmp421.c index ef3c682e32..a3db57dcb5 100644 --- a/hw/misc/tmp421.c +++ b/hw/misc/tmp421.c @@ -337,22 +337,6 @@ static void tmp421_realize(DeviceState *dev, Error **e= rrp) tmp421_reset(&s->i2c); } =20 -static void tmp421_initfn(Object *obj) -{ - object_property_add(obj, "temperature0", "int", - tmp421_get_temperature, - tmp421_set_temperature, NULL, NULL); - object_property_add(obj, "temperature1", "int", - tmp421_get_temperature, - tmp421_set_temperature, NULL, NULL); - object_property_add(obj, "temperature2", "int", - tmp421_get_temperature, - tmp421_set_temperature, NULL, NULL); - object_property_add(obj, "temperature3", "int", - tmp421_get_temperature, - tmp421_set_temperature, NULL, NULL); -} - static void tmp421_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -365,6 +349,19 @@ static void tmp421_class_init(ObjectClass *klass, void= *data) k->send =3D tmp421_tx; dc->vmsd =3D &vmstate_tmp421; sc->dev =3D (DeviceInfo *) data; + + object_class_property_add(klass, "temperature0", "int", + tmp421_get_temperature, + tmp421_set_temperature, NULL, NULL); + object_class_property_add(klass, "temperature1", "int", + tmp421_get_temperature, + tmp421_set_temperature, NULL, NULL); + object_class_property_add(klass, "temperature2", "int", + tmp421_get_temperature, + tmp421_set_temperature, NULL, NULL); + object_class_property_add(klass, "temperature3", "int", + tmp421_get_temperature, + tmp421_set_temperature, NULL, NULL); } =20 static const TypeInfo tmp421_info =3D { @@ -372,7 +369,6 @@ static const TypeInfo tmp421_info =3D { .parent =3D TYPE_I2C_SLAVE, .instance_size =3D sizeof(TMP421State), .class_size =3D sizeof(TMP421Class), - .instance_init =3D tmp421_initfn, .abstract =3D true, }; =20 --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120099; cv=none; d=zohomail.com; s=zohoarc; b=H6Q1h0ivIM6ymEW5RJfE3D9/me7NXGLXxYosKDmWs150R8NuDPB5SJWS9phFVlUHjtASa+oV6RWyyz2LK+amZ++RPGKHWAIs7UIR7K7Ff6OTUwDNgZkfQ38jXo90DEUHWUO4ixbWofQnqKkFi9M3v27yHG1k5OgzwR+fie4KYFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120099; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6wipV9DyT8v9GxPLDtRf53NrVtpF9utbNGmD7d2mTqo=; b=HjOvrMV6q54MRC8pvp4sFXNRlOsikFnjB9N8+AU/xN2zKyb5lVUebtbecR2hFJ+Z47dw1AZ8U6b8qaGFICt+ltA+YVLe04Z/ptbCmqWMHggUtd1Q3kDYHeBdLRk5FauNrJ++00gWQEaFNHJNhFCpz2WqUg1znvv/5MabuTVIMmE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120099919954.9684556116218; Wed, 11 Nov 2020 10:41:39 -0800 (PST) Received: from localhost ([::1]:33876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv3q-0001zg-KM for importer@patchew.org; Wed, 11 Nov 2020 13:41:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv0v-0000Bj-FD for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv0t-0007x9-Hk for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:37 -0500 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-214-4I9-urgrMJ2FalpSwpxkQw-1; Wed, 11 Nov 2020 13:38:33 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37DBC802B56; Wed, 11 Nov 2020 18:38:32 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2A385B4D2; Wed, 11 Nov 2020 18:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119914; 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=6wipV9DyT8v9GxPLDtRf53NrVtpF9utbNGmD7d2mTqo=; b=cwx9bUT7gDc9GNByR05IsU7e2RwGLknPx2zibxlxE1Y02who3PUe8NIwiRdGl6QuG32TpX Dg7msX04QPx5Cm+78kvXicm2iBdvjm3dINPwGHZckDTDIWoCf7wCaX2JvOnHIzyh09qrD2 zIM5MTm2NKi0t9t9ISqMztI0phd91ew= X-MC-Unique: 4I9-urgrMJ2FalpSwpxkQw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 04/12] i386: Register feature bit properties as class properties Date: Wed, 11 Nov 2020 13:38:15 -0500 Message-Id: <20201111183823.283752-5-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , Richard Henderson , "Daniel P. Berrange" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Remove x86_cpu_release_bit_prop() function, as we will allocate BitProperty only once and never free the class property list --- Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- target/i386/cpu.c | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 0d8606958e..dbba1151f2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6823,29 +6823,23 @@ static void x86_cpu_set_bit_prop(Object *obj, Visit= or *v, const char *name, cpu->env.user_features[fp->w] |=3D fp->mask; } =20 -static void x86_cpu_release_bit_prop(Object *obj, const char *name, - void *opaque) -{ - BitProperty *prop =3D opaque; - g_free(prop); -} - /* Register a boolean property to get/set a single bit in a uint32_t field. * * The same property name can be registered multiple times to make it affe= ct * multiple bits in the same FeatureWord. In that case, the getter will re= turn * true only if all bits are set. */ -static void x86_cpu_register_bit_prop(X86CPU *cpu, +static void x86_cpu_register_bit_prop(X86CPUClass *xcc, const char *prop_name, FeatureWord w, int bitnr) { + ObjectClass *oc =3D OBJECT_CLASS(xcc); BitProperty *fp; ObjectProperty *op; uint64_t mask =3D (1ULL << bitnr); =20 - op =3D object_property_find(OBJECT(cpu), prop_name); + op =3D object_class_property_find(oc, prop_name); if (op) { fp =3D op->opaque; assert(fp->w =3D=3D w); @@ -6854,14 +6848,14 @@ static void x86_cpu_register_bit_prop(X86CPU *cpu, fp =3D g_new0(BitProperty, 1); fp->w =3D w; fp->mask =3D mask; - object_property_add(OBJECT(cpu), prop_name, "bool", - x86_cpu_get_bit_prop, - x86_cpu_set_bit_prop, - x86_cpu_release_bit_prop, fp); + object_class_property_add(oc, prop_name, "bool", + x86_cpu_get_bit_prop, + x86_cpu_set_bit_prop, + NULL, fp); } } =20 -static void x86_cpu_register_feature_bit_props(X86CPU *cpu, +static void x86_cpu_register_feature_bit_props(X86CPUClass *xcc, FeatureWord w, int bitnr) { @@ -6880,7 +6874,7 @@ static void x86_cpu_register_feature_bit_props(X86CPU= *cpu, /* aliases don't use "|" delimiters anymore, they are registered * manually using object_property_add_alias() */ assert(!strchr(name, '|')); - x86_cpu_register_bit_prop(cpu, name, w, bitnr); + x86_cpu_register_bit_prop(xcc, name, w, bitnr); } =20 #if !defined(CONFIG_USER_ONLY) @@ -6934,7 +6928,6 @@ static void x86_cpu_initfn(Object *obj) X86CPU *cpu =3D X86_CPU(obj); X86CPUClass *xcc =3D X86_CPU_GET_CLASS(obj); CPUX86State *env =3D &cpu->env; - FeatureWord w; =20 env->nr_dies =3D 1; cpu_set_cpustate_pointers(cpu); @@ -6946,14 +6939,6 @@ static void x86_cpu_initfn(Object *obj) x86_cpu_get_feature_words, NULL, NULL, (void *)cpu->filtered_features); =20 - for (w =3D 0; w < FEATURE_WORDS; w++) { - int bitnr; - - for (bitnr =3D 0; bitnr < 64; bitnr++) { - x86_cpu_register_feature_bit_props(cpu, w, bitnr); - } - } - object_property_add_alias(obj, "sse3", obj, "pni"); object_property_add_alias(obj, "pclmuldq", obj, "pclmulqdq"); object_property_add_alias(obj, "sse4-1", obj, "sse4.1"); @@ -7239,6 +7224,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) X86CPUClass *xcc =3D X86_CPU_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); DeviceClass *dc =3D DEVICE_CLASS(oc); + FeatureWord w; =20 device_class_set_parent_realize(dc, x86_cpu_realizefn, &xcc->parent_realize); @@ -7328,6 +7314,12 @@ static void x86_cpu_common_class_init(ObjectClass *o= c, void *data) x86_cpu_get_crash_info_qom, NULL, NULL, NULL= ); #endif =20 + for (w =3D 0; w < FEATURE_WORDS; w++) { + int bitnr; + for (bitnr =3D 0; bitnr < 64; bitnr++) { + x86_cpu_register_feature_bit_props(xcc, w, bitnr); + } + } } =20 static const TypeInfo x86_cpu_type_info =3D { --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120561; cv=none; d=zohomail.com; s=zohoarc; b=bF6zZKFkuPUuZRyVqsQjBwCZDqUX/8d//gI/1/wnbuVw95TkKvIczPiCD5n0QXXiiZURaHJ9zfBlrnsBGPcDXSvDoHvZ21OhLiU6EVI7e9Jhxl5ukY16zkIWKPetB7d6GG2vTgrMyCebttg2MYfrZCqjAIZihwtEF2mMy0O98XI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120561; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g1BuxTUhsmcY0SFuQ3DYGN96ziKI4fIsmsSBKpMTc1E=; b=Na6tyZCOGKqgzJa/yLLkruUoUzBLFbXZhfdthYrfvIzmi/Mmyc/BylAQL1Oua95MprNpFL2W+ZV6FvefkZNFH20p53dlv+3jQgTXkqi0zBmCqG9vyW+XNpA3H4pKICQxmXbFPmkLqHFlFdYeTvhe+aG8Q4jj/2d9uvDQxD/tAow= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120561894839.0972330765072; Wed, 11 Nov 2020 10:49:21 -0800 (PST) Received: from localhost ([::1]:56734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcvBI-00038C-R5 for importer@patchew.org; Wed, 11 Nov 2020 13:49:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv1o-0000ZB-QI for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:39:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv1m-0008GS-Bw for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:39:32 -0500 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-56-jC_RUB9zM0uj-G7-tsmJjQ-1; Wed, 11 Nov 2020 13:38:55 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 837815F9C2; Wed, 11 Nov 2020 18:38:33 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F9325DA6A; Wed, 11 Nov 2020 18:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119969; 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=g1BuxTUhsmcY0SFuQ3DYGN96ziKI4fIsmsSBKpMTc1E=; b=NRHmsq2XS8wjsm6bWPaoYEy+jYTWNjyWwMq7dJQeFc1wc4+7lGGp4AeHu3lMy9YpN9IIpC o/ijFHJQ8+cXIFVsEorZfKYCgAJTdrisHGHAy2aHJpzKPu1LFbCetLh7mp56t0kVFFYWBM HG86moDMPqtApqzcM3fT/nbgUwYbDdo= X-MC-Unique: jC_RUB9zM0uj-G7-tsmJjQ-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 05/12] arm/virt: Register most properties as class properties Date: Wed, 11 Nov 2020 13:38:16 -0500 Message-Id: <20201111183823.283752-6-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , qemu-arm@nongnu.org, "Daniel P. Berrange" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/virt.c | 76 +++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 27dbeb549e..53fcaf5e4f 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2484,6 +2484,47 @@ static void virt_machine_class_init(ObjectClass *oc,= void *data) NULL, NULL); object_class_property_set_description(oc, "acpi", "Enable ACPI"); + object_class_property_add_bool(oc, "secure", virt_get_secure, + virt_set_secure); + object_class_property_set_description(oc, "secure", + "Set on/off to enable/disa= ble the ARM " + "Security Extensions (Trus= tZone)"); + + object_class_property_add_bool(oc, "virtualization", virt_get_virt, + virt_set_virt); + object_class_property_set_description(oc, "virtualization", + "Set on/off to enable/disable em= ulating a " + "guest CPU which implements the = ARM " + "Virtualization Extensions"); + + object_class_property_add_bool(oc, "highmem", virt_get_highmem, + virt_set_highmem); + object_class_property_set_description(oc, "highmem", + "Set on/off to enable/disable us= ing " + "physical address space above 32= bits"); + + object_class_property_add_str(oc, "gic-version", virt_get_gic_version, + virt_set_gic_version); + object_class_property_set_description(oc, "gic-version", + "Set GIC version. " + "Valid values are 2, 3, host and= max"); + + object_class_property_add_str(oc, "iommu", virt_get_iommu, virt_set_io= mmu); + object_class_property_set_description(oc, "iommu", + "Set the IOMMU type. " + "Valid values are none and smmuv= 3"); + + object_class_property_add_bool(oc, "ras", virt_get_ras, + virt_set_ras); + object_class_property_set_description(oc, "ras", + "Set on/off to enable/disable re= porting host memory errors " + "to a KVM guest using ACPI and g= uest external abort exceptions"); + + object_class_property_add_bool(oc, "mte", virt_get_mte, virt_set_mte); + object_class_property_set_description(oc, "mte", + "Set on/off to enable/disable em= ulating a " + "guest CPU which implements the = ARM " + "Memory Tagging Extension"); } =20 static void virt_instance_init(Object *obj) @@ -2496,34 +2537,13 @@ static void virt_instance_init(Object *obj) * boot UEFI blobs which assume no TrustZone support. */ vms->secure =3D false; - object_property_add_bool(obj, "secure", virt_get_secure, - virt_set_secure); - object_property_set_description(obj, "secure", - "Set on/off to enable/disable the ARM " - "Security Extensions (TrustZone)"); =20 /* EL2 is also disabled by default, for similar reasons */ vms->virt =3D false; - object_property_add_bool(obj, "virtualization", virt_get_virt, - virt_set_virt); - object_property_set_description(obj, "virtualization", - "Set on/off to enable/disable emulatin= g a " - "guest CPU which implements the ARM " - "Virtualization Extensions"); =20 /* High memory is enabled by default */ vms->highmem =3D true; - object_property_add_bool(obj, "highmem", virt_get_highmem, - virt_set_highmem); - object_property_set_description(obj, "highmem", - "Set on/off to enable/disable using " - "physical address space above 32 bits"= ); vms->gic_version =3D VIRT_GIC_VERSION_NOSEL; - object_property_add_str(obj, "gic-version", virt_get_gic_version, - virt_set_gic_version); - object_property_set_description(obj, "gic-version", - "Set GIC version. " - "Valid values are 2, 3, host and max"); =20 vms->highmem_ecam =3D !vmc->no_highmem_ecam; =20 @@ -2541,26 +2561,12 @@ static void virt_instance_init(Object *obj) =20 /* Default disallows iommu instantiation */ vms->iommu =3D VIRT_IOMMU_NONE; - object_property_add_str(obj, "iommu", virt_get_iommu, virt_set_iommu); - object_property_set_description(obj, "iommu", - "Set the IOMMU type. " - "Valid values are none and smmuv3"); =20 /* Default disallows RAS instantiation */ vms->ras =3D false; - object_property_add_bool(obj, "ras", virt_get_ras, - virt_set_ras); - object_property_set_description(obj, "ras", - "Set on/off to enable/disable reportin= g host memory errors " - "to a KVM guest using ACPI and guest e= xternal abort exceptions"); =20 /* MTE is disabled by default. */ vms->mte =3D false; - object_property_add_bool(obj, "mte", virt_get_mte, virt_set_mte); - object_property_set_description(obj, "mte", - "Set on/off to enable/disable emulatin= g a " - "guest CPU which implements the ARM " - "Memory Tagging Extension"); =20 vms->irqmap =3D a15irqmap; =20 --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120213; cv=none; d=zohomail.com; s=zohoarc; b=SKUpFgzP5g2ThN4PT4VmOqjjloPNAEi1y8yYdE7RoZ55xYG84GqxA6io0uc4jmFAVB3zHwBK9eJ7siXdxeFkADVl4OB0C+pW4saiHEXJH42bBv6s5+9YFYRvzmKTsE7QIUKuj7kNHUtkTmYCTRByL4jy3k64m4DmGDA6qPXg9TY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120213; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GM7yHtXmsvdlS2d7gUReDtGettnNVOSzGUug6VroSwc=; b=jw8Nxp66OhCn+X+BqfcQMT3KicDbSxAoeL8s7sGq4azj3z9MumQVo+X3V4pbQyYe6QD4W9sRBHQKG+z108oWYxg4JAkk/5OxEQgtCkgrJs3kJlsCwrK6eEhUZCm3GMTszoh9xeHMJ7CEdsOj7TepFR7u3xfNj1InCsrmm+p277U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120213925483.7409995656154; Wed, 11 Nov 2020 10:43:33 -0800 (PST) Received: from localhost ([::1]:40064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv5g-0004Yo-Fn for importer@patchew.org; Wed, 11 Nov 2020 13:43:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv0z-0000GK-Hg for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv0x-0007yq-Nv for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:41 -0500 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-59-oK5XFC-2PWisD838sPai6w-1; Wed, 11 Nov 2020 13:38:36 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBE3D1006C84; Wed, 11 Nov 2020 18:38:34 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 422FB7366F; Wed, 11 Nov 2020 18:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119918; 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=GM7yHtXmsvdlS2d7gUReDtGettnNVOSzGUug6VroSwc=; b=GueqjTnrVyrCIs0YPTuYHlBNCVk1xrSNacPQLscJNuxdDwlftLpbXlRlpjWjF226UTQJYN 1KiC+g31Vd1sVX76H2PIiK7qRtqjNzldCM3NqwABWuzGDU+cl9wWrb0WEqJX4LlvCtbMrP SklarlsDsOJhiugp/hsX5DXKk+tnm78= X-MC-Unique: oK5XFC-2PWisD838sPai6w-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 06/12] virt: Register "its" as class property Date: Wed, 11 Nov 2020 13:38:17 -0500 Message-Id: <20201111183823.283752-7-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:49:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , qemu-arm@nongnu.org, "Daniel P. Berrange" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Note: "its" is currently registered conditionally, but this makes the feature be registered unconditionally. The only side effect is that it will be now possible to set its=3Don on virt-2.7 and older. Signed-off-by: Eduardo Habkost Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org --- hw/arm/virt.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 53fcaf5e4f..37a020c149 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2525,6 +2525,13 @@ static void virt_machine_class_init(ObjectClass *oc,= void *data) "Set on/off to enable/disable em= ulating a " "guest CPU which implements the = ARM " "Memory Tagging Extension"); + + object_class_property_add_bool(oc, "its", virt_get_its, + virt_set_its); + object_class_property_set_description(oc, "its", + "Set on/off to enable/disable " + "ITS instantiation"); + } =20 static void virt_instance_init(Object *obj) @@ -2552,11 +2559,6 @@ static void virt_instance_init(Object *obj) } else { /* Default allows ITS instantiation */ vms->its =3D true; - object_property_add_bool(obj, "its", virt_get_its, - virt_set_its); - object_property_set_description(obj, "its", - "Set on/off to enable/disable " - "ITS instantiation"); } =20 /* Default disallows iommu instantiation */ --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120080; cv=none; d=zohomail.com; s=zohoarc; b=XHFkglcnGKsyV868Ael41gLG8jcb1bFoUvSi5JzLu7vpRXdF2RnzplVBzsQVTZQ2ypf1ZSskM/48u2o34FCbD/NfY+HzTBLlI1G4mhMYZk0yZ+/ZxokADrXWueO8BNZcH09PYv9qev4L1Xjhkezy0azg2OkTMJRkfOYF856jOq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120080; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PcPpBCTO/OGmj1460lh+NKkFRuN0e9q5i3elpdRuoLA=; b=QN0OD7xqwSHbqXrVtv8ZmK9eYLdThd/+aeo2sT2GQ/strzTw9Za+DqST32B+Ia74npR6YCSNhCCOIRBnfl6s8S9Wc7NI4rFE8hX/3PkPX2VoM4ZwhI1WNBB7skIM2Ri+Hufl9ErEF5KsIHWAcEzhH22HSBe1flQoN54k5iArJ5w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120080850700.6774947103994; Wed, 11 Nov 2020 10:41:20 -0800 (PST) Received: from localhost ([::1]:33384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv3X-0001lp-Ap for importer@patchew.org; Wed, 11 Nov 2020 13:41:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv13-0000JA-Bk for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv10-00081S-SJ for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:44 -0500 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-202-2RgKfFigOMGsRS4_eq4Mzg-1; Wed, 11 Nov 2020 13:38:38 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42A5C186DD40; Wed, 11 Nov 2020 18:38:36 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id C363127BCD; Wed, 11 Nov 2020 18:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119921; 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=PcPpBCTO/OGmj1460lh+NKkFRuN0e9q5i3elpdRuoLA=; b=KHmDynxxD1eronHFagmz9l1+g31xZE+ImdmZObN8XJ5dkP9rGwGXZYEbUgyIMe273da5RK oeHPJCA76w3Ko7dazQHwyNNdHHJueWLOqMQLkRP2HP9rUdWROSVu2NErEpMCXEUuEtJh7S UpGVxvDkO/R1bqfWKqHYe0UUZq8OyZY= X-MC-Unique: 2RgKfFigOMGsRS4_eq4Mzg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 07/12] arm/cpu64: Register "aarch64" as class property Date: Wed, 11 Nov 2020 13:38:18 -0500 Message-Id: <20201111183823.283752-8-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , qemu-arm@nongnu.org, "Daniel P. Berrange" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost Reviewed-by: Peter Maydell --- Cc: Peter Maydell Cc: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org --- target/arm/cpu64.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 649213082f..7cf9fc4bc6 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -762,15 +762,6 @@ static void aarch64_cpu_set_aarch64(Object *obj, bool = value, Error **errp) } } =20 -static void aarch64_cpu_initfn(Object *obj) -{ - object_property_add_bool(obj, "aarch64", aarch64_cpu_get_aarch64, - aarch64_cpu_set_aarch64); - object_property_set_description(obj, "aarch64", - "Set on/off to enable/disable aarch64 " - "execution state "); -} - static void aarch64_cpu_finalizefn(Object *obj) { } @@ -790,6 +781,12 @@ static void aarch64_cpu_class_init(ObjectClass *oc, vo= id *data) cc->gdb_num_core_regs =3D 34; cc->gdb_core_xml_file =3D "aarch64-core.xml"; cc->gdb_arch_name =3D aarch64_gdb_arch_name; + + object_class_property_add_bool(oc, "aarch64", aarch64_cpu_get_aarch64, + aarch64_cpu_set_aarch64); + object_class_property_set_description(oc, "aarch64", + "Set on/off to enable/disable aa= rch64 " + "execution state "); } =20 static void aarch64_cpu_instance_init(Object *obj) @@ -827,7 +824,6 @@ static const TypeInfo aarch64_cpu_type_info =3D { .name =3D TYPE_AARCH64_CPU, .parent =3D TYPE_ARM_CPU, .instance_size =3D sizeof(ARMCPU), - .instance_init =3D aarch64_cpu_initfn, .instance_finalize =3D aarch64_cpu_finalizefn, .abstract =3D true, .class_size =3D sizeof(AArch64CPUClass), --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120344; cv=none; d=zohomail.com; s=zohoarc; b=jrGUAM7q71TRIqOGUZRMdPvCcTnApDb0Ftb5tA4wZ+AaDA5mwOceI3kgxnM7iQFsqLg4s/ai/Z64rU0lXt6NqD6PmBgWnxO81fmAN70w7l/MYs9D1qUd8vJVrTmW2Zd7KnbyHH5Pya5z4EQYVYKdZXbgAYF7X31+5kNgf1GZ0e4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120344; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ev6WMWOMh5c81uniczKJjEL9VGNxGrdq1JudUKbBrGU=; b=jYdukGwPaiTUL/jiVgOYS2njj0/W+Tsa8OhTXmTdT33SFejXw918QjwawHRi9bfI8SGX3V+W9WweouOwZXXV1Q3wGTdfuQ64giui3DdD+fnN6QDSB1Se4XakKyiPpzWXjKBJpID7iQIpaYai0TfqP5fO1kX48pengaWj1p1Lnx0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120344084976.4631854133926; Wed, 11 Nov 2020 10:45:44 -0800 (PST) Received: from localhost ([::1]:46286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv7m-00076g-SO for importer@patchew.org; Wed, 11 Nov 2020 13:45:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv13-0000Jn-N5 for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:41304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv10-00081M-AU for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:45 -0500 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-20-FlGI8iBdPM2DYoseZgDKDg-1; Wed, 11 Nov 2020 13:38:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27570107465F; Wed, 11 Nov 2020 18:38:38 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62DCC10013D9; Wed, 11 Nov 2020 18:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119921; 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=ev6WMWOMh5c81uniczKJjEL9VGNxGrdq1JudUKbBrGU=; b=InjInPhqok/eUaRgrfnjW9+PQNlignVJEGaWxTQpID35Ssy3luaWkadHGL4fuEaXeLapKh 0uj6pqplbn3tszYTDXLUS2uDq7mBxuxjFkyod6KCdEnZy4n0sBpsOR/IdF/9oUol/3tNqi 8nH6ALPw6RWX6tKbMLOxVX4WY+LrwQs= X-MC-Unique: FlGI8iBdPM2DYoseZgDKDg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 08/12] can_host: Use class properties Date: Wed, 11 Nov 2020 13:38:19 -0500 Message-Id: <20201111183823.283752-9-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vikram Garhwal , "Daniel P. Berrange" , Jason Wang , Paolo Bonzini , John Snow , Pavel Pisa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost Tested-by: Pavel Pisa --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties Message-Id: <20201009160122.1662082-1-ehabkost@redhat.com> https://lore.kernel.org/qemu-devel/20201009160122.1662082-1-ehabkost@redhat= .com --- Cc: Pavel Pisa Cc: Vikram Garhwal Cc: Jason Wang Cc: qemu-devel@nongnu.org --- net/can/can_host.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/net/can/can_host.c b/net/can/can_host.c index be4547d913..bec88b9620 100644 --- a/net/can/can_host.c +++ b/net/can/can_host.c @@ -72,21 +72,16 @@ static void can_host_complete(UserCreatable *uc, Error = **errp) can_host_connect(CAN_HOST(uc), errp); } =20 -static void can_host_instance_init(Object *obj) -{ - CanHostState *ch =3D CAN_HOST(obj); - - object_property_add_link(obj, "canbus", TYPE_CAN_BUS, - (Object **)&ch->bus, - object_property_allow_set_link, - OBJ_PROP_LINK_STRONG); -} - static void can_host_class_init(ObjectClass *klass, void *class_data G_GNUC_UNUSED) { UserCreatableClass *uc_klass =3D USER_CREATABLE_CLASS(klass); =20 + object_class_property_add_link(klass, "canbus", TYPE_CAN_BUS, + offsetof(CanHostState, bus), + object_property_allow_set_link, + OBJ_PROP_LINK_STRONG); + klass->unparent =3D can_host_unparent; uc_klass->complete =3D can_host_complete; } @@ -97,7 +92,6 @@ static const TypeInfo can_host_info =3D { .instance_size =3D sizeof(CanHostState), .class_size =3D sizeof(CanHostClass), .abstract =3D true, - .instance_init =3D can_host_instance_init, .class_init =3D can_host_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120460; cv=none; d=zohomail.com; s=zohoarc; b=dghNkGd3SKUYMclSxPlhB06mVsVz7O9C6u69M+yDlR2e4voVL7MP1aqSwgh2al1HwDWVaRm1xUtZeChKmCViCP413RR4FU8I8xhqZAtClr2gZu4PIBIGjM9pmQ7LerCLbY7L9tyygqo7AE9Sd0sDKXyweNAJb88iQyEN62Y7YCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120460; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/3T9jwyO7+gzlJ0IX2u7iMLQEH5y1V/+ocQuhIaLuPI=; b=Xlve6ggdAuKNF3snoGxwgJYB7lGE3iFfUhdx+uWcIKQPXKsI+9XgFMSWaPYssl2YGehwFdw2ABfcUrmKcga0SpwrNron2QmXlUz+BXzsB9LelWrIOiFK+nEV5ILIfEJkTEt2OnK700md6I9XG7pg9hdyu7oqEs/oqYHFBWEABdM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120460677280.4991904502275; Wed, 11 Nov 2020 10:47:40 -0800 (PST) Received: from localhost ([::1]:52654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv9f-0001RW-ES for importer@patchew.org; Wed, 11 Nov 2020 13:47:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv15-0000Kw-NI for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv13-00083W-DO for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:47 -0500 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-43-FvkHv3zCN3-9ieHPcvAy-w-1; Wed, 11 Nov 2020 13:38:40 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 33D491006C84; Wed, 11 Nov 2020 18:38:39 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id D865575125; Wed, 11 Nov 2020 18:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119924; 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=/3T9jwyO7+gzlJ0IX2u7iMLQEH5y1V/+ocQuhIaLuPI=; b=GcpmX8vdXOs1chc3Z7zV2izFojmTJshC1r+MFUbDVgG/NA7EBSNK4lXj5kPN2Z6gK9F2VC o53114jGjsluzA760E3zfl/NNvm1S+c2MGGzYbZLa+nWvSKwIyE+GYyt+sidSBgufD0H7g y7bnSAmk9/MnThLpE197Ep8UZxlb2XI= X-MC-Unique: FvkHv3zCN3-9ieHPcvAy-w-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 09/12] colo: Use class properties Date: Wed, 11 Nov 2020 13:38:20 -0500 Message-Id: <20201111183823.283752-10-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:49:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Daniel P. Berrange" , Li Zhijian , Jason Wang , Zhang Chen , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost Reviewed-by: Zhang Chen --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties Message-Id: <20201009160122.1662082-1-ehabkost@redhat.com> https://lore.kernel.org/qemu-devel/20201009160122.1662082-1-ehabkost@redhat= .com --- Cc: Zhang Chen Cc: Li Zhijian Cc: Jason Wang Cc: qemu-devel@nongnu.org --- net/colo-compare.c | 57 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 3a45d64175..017e82dd8b 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1375,6 +1375,35 @@ static void colo_compare_class_init(ObjectClass *oc,= void *data) { UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 + object_class_property_add_str(oc, "primary_in", + compare_get_pri_indev, compare_set_pri_i= ndev); + object_class_property_add_str(oc, "secondary_in", + compare_get_sec_indev, compare_set_sec_i= ndev); + object_class_property_add_str(oc, "outdev", + compare_get_outdev, compare_set_outdev); + object_class_property_add_link(oc, "iothread", TYPE_IOTHREAD, + offsetof(CompareState, iothread), + object_property_allow_set_link, + OBJ_PROP_LINK_STRONG); + /* This parameter just for Xen COLO */ + object_class_property_add_str(oc, "notify_dev", + compare_get_notify_dev, compare_set_noti= fy_dev); + + object_class_property_add(oc, "compare_timeout", "uint32", + compare_get_timeout, + compare_set_timeout, NULL, NULL); + + object_class_property_add(oc, "expired_scan_cycle", "uint32", + compare_get_expired_scan_cycle, + compare_set_expired_scan_cycle, NULL, NULL); + + object_class_property_add(oc, "max_queue_size", "uint32", + get_max_queue_size, + set_max_queue_size, NULL, NULL); + + object_class_property_add_bool(oc, "vnet_hdr_support", compare_get_vne= t_hdr, + compare_set_vnet_hdr); + ucc->complete =3D colo_compare_complete; } =20 @@ -1382,35 +1411,7 @@ static void colo_compare_init(Object *obj) { CompareState *s =3D COLO_COMPARE(obj); =20 - object_property_add_str(obj, "primary_in", - compare_get_pri_indev, compare_set_pri_indev); - object_property_add_str(obj, "secondary_in", - compare_get_sec_indev, compare_set_sec_indev); - object_property_add_str(obj, "outdev", - compare_get_outdev, compare_set_outdev); - object_property_add_link(obj, "iothread", TYPE_IOTHREAD, - (Object **)&s->iothread, - object_property_allow_set_link, - OBJ_PROP_LINK_STRONG); - /* This parameter just for Xen COLO */ - object_property_add_str(obj, "notify_dev", - compare_get_notify_dev, compare_set_notify_dev= ); - - object_property_add(obj, "compare_timeout", "uint32", - compare_get_timeout, - compare_set_timeout, NULL, NULL); - - object_property_add(obj, "expired_scan_cycle", "uint32", - compare_get_expired_scan_cycle, - compare_set_expired_scan_cycle, NULL, NULL); - - object_property_add(obj, "max_queue_size", "uint32", - get_max_queue_size, - set_max_queue_size, NULL, NULL); - s->vnet_hdr =3D false; - object_property_add_bool(obj, "vnet_hdr_support", compare_get_vnet_hdr, - compare_set_vnet_hdr); } =20 static void colo_compare_finalize(Object *obj) --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120597; cv=none; d=zohomail.com; s=zohoarc; b=CUTJ4NT8M9XHOFZBURjJ4ueEfUiEec0xmMYmxzjCOcb1sKuHsfee0DWMYW3vVDft6iyHgdzDf2jcgFA5GSi3VJPOQIAk6hM2AgYb4hl7PXEYNd0Egdfx9/rVJ0VHiKtL71eiZSCkbLVd/4QelnZjM+l30ptQgF5rclkbR3WFWWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120597; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z45gbVkVg837PGXGDvaAalAXkFpg8UQLIq6eLwTeuEQ=; b=Hq5AWdKnzM7e0Rz1o4v+L1Eo62yfBvC9uNAblaJ4IvA8h3kbA3KbQBfz3LF7JFtCdOFRSAKXgDW8zom+L2uJeWFOe/8t1ocJOXs7ZiSpRbFFZZWYzU5LMjcEpqHkvKPPO+j8oCMuCbATHyxJN/eun7v4D9NaNMTWX/tM1CEq4sA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160512059711912.070433753451766; Wed, 11 Nov 2020 10:49:57 -0800 (PST) Received: from localhost ([::1]:58824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcvBq-00040f-Vy for importer@patchew.org; Wed, 11 Nov 2020 13:49:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv17-0000MA-1R for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39283) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv13-00083O-4b for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:48 -0500 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-256-F5ffE0N8Mb-lgI1EDw-JyQ-1; Wed, 11 Nov 2020 13:38:41 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 43D055F9DA; Wed, 11 Nov 2020 18:38:40 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEA6319C66; Wed, 11 Nov 2020 18:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119923; 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=z45gbVkVg837PGXGDvaAalAXkFpg8UQLIq6eLwTeuEQ=; b=Lit1lVuRntdn3sv72l4XJ0iCoWL7q3ZeS8LY6gqjhEJTzjWiCz/N7E3E1XFiZHaPGJTqNd ykphrS7L5KIzXMtGrtYD/a9fMrpxA7uRB560jE2/e50Xs0Gt2d6tuUMhkEBaV6li26ElEP U++8/sDrHM34eVGgPmv5LW01gwJBJj8= X-MC-Unique: F5ffE0N8Mb-lgI1EDw-JyQ-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 10/12] netfilter: Reorder functions Date: Wed, 11 Nov 2020 13:38:21 -0500 Message-Id: <20201111183823.283752-11-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Daniel P. Berrange" , Li Zhijian , Jason Wang , Zhang Chen , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Trivial code reordering in some filter backends, to make the next changes easier to review. Signed-off-by: Eduardo Habkost --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties Message-Id: <20201009160122.1662082-1-ehabkost@redhat.com> https://lore.kernel.org/qemu-devel/20201009160122.1662082-1-ehabkost@redhat= .com --- Cc: Jason Wang Cc: Zhang Chen Cc: Li Zhijian Cc: qemu-devel@nongnu.org --- net/filter-buffer.c | 20 ++++++++++---------- net/filter-mirror.c | 36 ++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/net/filter-buffer.c b/net/filter-buffer.c index d8392be53c..95e384865f 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -144,16 +144,6 @@ static void filter_buffer_status_changed(NetFilterStat= e *nf, Error **errp) } } =20 -static void filter_buffer_class_init(ObjectClass *oc, void *data) -{ - NetFilterClass *nfc =3D NETFILTER_CLASS(oc); - - nfc->setup =3D filter_buffer_setup; - nfc->cleanup =3D filter_buffer_cleanup; - nfc->receive_iov =3D filter_buffer_receive_iov; - nfc->status_changed =3D filter_buffer_status_changed; -} - static void filter_buffer_get_interval(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) @@ -182,6 +172,16 @@ static void filter_buffer_set_interval(Object *obj, Vi= sitor *v, s->interval =3D value; } =20 +static void filter_buffer_class_init(ObjectClass *oc, void *data) +{ + NetFilterClass *nfc =3D NETFILTER_CLASS(oc); + + nfc->setup =3D filter_buffer_setup; + nfc->cleanup =3D filter_buffer_cleanup; + nfc->receive_iov =3D filter_buffer_receive_iov; + nfc->status_changed =3D filter_buffer_status_changed; +} + static void filter_buffer_init(Object *obj) { object_property_add(obj, "interval", "uint32", diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 088d4dcace..26b783011a 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -284,24 +284,6 @@ static void filter_redirector_setup(NetFilterState *nf= , Error **errp) } } =20 -static void filter_mirror_class_init(ObjectClass *oc, void *data) -{ - NetFilterClass *nfc =3D NETFILTER_CLASS(oc); - - nfc->setup =3D filter_mirror_setup; - nfc->cleanup =3D filter_mirror_cleanup; - nfc->receive_iov =3D filter_mirror_receive_iov; -} - -static void filter_redirector_class_init(ObjectClass *oc, void *data) -{ - NetFilterClass *nfc =3D NETFILTER_CLASS(oc); - - nfc->setup =3D filter_redirector_setup; - nfc->cleanup =3D filter_redirector_cleanup; - nfc->receive_iov =3D filter_redirector_receive_iov; -} - static char *filter_redirector_get_indev(Object *obj, Error **errp) { MirrorState *s =3D FILTER_REDIRECTOR(obj); @@ -388,6 +370,24 @@ static void filter_redirector_set_vnet_hdr(Object *obj, s->vnet_hdr =3D value; } =20 +static void filter_mirror_class_init(ObjectClass *oc, void *data) +{ + NetFilterClass *nfc =3D NETFILTER_CLASS(oc); + + nfc->setup =3D filter_mirror_setup; + nfc->cleanup =3D filter_mirror_cleanup; + nfc->receive_iov =3D filter_mirror_receive_iov; +} + +static void filter_redirector_class_init(ObjectClass *oc, void *data) +{ + NetFilterClass *nfc =3D NETFILTER_CLASS(oc); + + nfc->setup =3D filter_redirector_setup; + nfc->cleanup =3D filter_redirector_cleanup; + nfc->receive_iov =3D filter_redirector_receive_iov; +} + static void filter_mirror_init(Object *obj) { MirrorState *s =3D FILTER_MIRROR(obj); --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120473; cv=none; d=zohomail.com; s=zohoarc; b=apuelQ3zAsoiLUGstvqI+m4zkZmLGZ3t+OLoqskesMlCCHBEoUm7JwfS5qL0AeqAFoexB5A/shS6L1YNHTA04Y0XXzN0H4my8sTRaL/Ur0NSxpP8TH2tyKmOiQVQMKsYP/s2pepgUnUHjdA92bVJCsInhazbcJy9umMywQw/T6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120473; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fZ6Z0/I3Uq9/7AEx6y6Wfw7R0lrw0v4sB/Zq1v+CEXY=; b=CpxvWDtauW7udb0DsrRDJ9yKTb62dzR77s7OJ7EU8zm7QMDsx2VzEHqDKb+GZzQdMCIwr2xU8hJTCyRdRyN+uvy8gS+TsPiWID/5/dFILitxcS1+uv90dOuqLzT3il2E+xzmNhHCWRFiJYO1o+wrGsdbJI+3BsBm/hio3AXkXgM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120473542311.7159652359853; Wed, 11 Nov 2020 10:47:53 -0800 (PST) Received: from localhost ([::1]:53334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv9s-0001iJ-By for importer@patchew.org; Wed, 11 Nov 2020 13:47:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv17-0000MN-BE for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv13-00083T-DT for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:48 -0500 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-404-K9QwSEaPM2O1dkjgpGjaRg-1; Wed, 11 Nov 2020 13:38:42 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 40F6C186DD29; Wed, 11 Nov 2020 18:38:41 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2FC25B4D2; Wed, 11 Nov 2020 18:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119924; 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=fZ6Z0/I3Uq9/7AEx6y6Wfw7R0lrw0v4sB/Zq1v+CEXY=; b=RLGD9T2XKQPG/gN0kwbppH6eYiIImBisBMvGe6KAa8zjSQ/3b45FRQ9L9PwEZuEpfu3wFu bhUM6x9OBz0YryY1dQXDWcrJa7cWgNNgkuZuvSGHP+U/jeulB6EK44okhcsk2odH17teC8 bvuo4R5XsT8yBBoBzGpJh/UnJCaRz4M= X-MC-Unique: K9QwSEaPM2O1dkjgpGjaRg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 11/12] netfilter: Use class properties Date: Wed, 11 Nov 2020 13:38:22 -0500 Message-Id: <20201111183823.283752-12-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Daniel P. Berrange" , Li Zhijian , Jason Wang , Zhang Chen , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties Message-Id: <20201009160122.1662082-1-ehabkost@redhat.com> https://lore.kernel.org/qemu-devel/20201009160122.1662082-1-ehabkost@redhat= .com --- Cc: Jason Wang Cc: Zhang Chen Cc: Li Zhijian Cc: qemu-devel@nongnu.org --- net/dump.c | 10 +++++----- net/filter-buffer.c | 12 ++++-------- net/filter-mirror.c | 28 ++++++++++++++-------------- net/filter-rewriter.c | 7 ++++--- net/filter.c | 24 ++++++++++++------------ 5 files changed, 39 insertions(+), 42 deletions(-) diff --git a/net/dump.c b/net/dump.c index 7fd448d2e1..4d538d82a6 100644 --- a/net/dump.c +++ b/net/dump.c @@ -224,11 +224,6 @@ static void filter_dump_instance_init(Object *obj) NetFilterDumpState *nfds =3D FILTER_DUMP(obj); =20 nfds->maxlen =3D 65536; - - object_property_add(obj, "maxlen", "uint32", filter_dump_get_maxlen, - filter_dump_set_maxlen, NULL, NULL); - object_property_add_str(obj, "file", file_dump_get_filename, - file_dump_set_filename); } =20 static void filter_dump_instance_finalize(Object *obj) @@ -242,6 +237,11 @@ static void filter_dump_class_init(ObjectClass *oc, vo= id *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 + object_class_property_add(oc, "maxlen", "uint32", filter_dump_get_maxl= en, + filter_dump_set_maxlen, NULL, NULL); + object_class_property_add_str(oc, "file", file_dump_get_filename, + file_dump_set_filename); + nfc->setup =3D filter_dump_setup; nfc->cleanup =3D filter_dump_cleanup; nfc->receive_iov =3D filter_dump_receive_iov; diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 95e384865f..283dc9cbe6 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -176,24 +176,20 @@ static void filter_buffer_class_init(ObjectClass *oc,= void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 + object_class_property_add(oc, "interval", "uint32", + filter_buffer_get_interval, + filter_buffer_set_interval, NULL, NULL); + nfc->setup =3D filter_buffer_setup; nfc->cleanup =3D filter_buffer_cleanup; nfc->receive_iov =3D filter_buffer_receive_iov; nfc->status_changed =3D filter_buffer_status_changed; } =20 -static void filter_buffer_init(Object *obj) -{ - object_property_add(obj, "interval", "uint32", - filter_buffer_get_interval, - filter_buffer_set_interval, NULL, NULL); -} - static const TypeInfo filter_buffer_info =3D { .name =3D TYPE_FILTER_BUFFER, .parent =3D TYPE_NETFILTER, .class_init =3D filter_buffer_class_init, - .instance_init =3D filter_buffer_init, .instance_size =3D sizeof(FilterBufferState), }; =20 diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 26b783011a..f8e65007c0 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -374,6 +374,12 @@ static void filter_mirror_class_init(ObjectClass *oc, = void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 + object_class_property_add_str(oc, "outdev", filter_mirror_get_outdev, + filter_mirror_set_outdev); + object_class_property_add_bool(oc, "vnet_hdr_support", + filter_mirror_get_vnet_hdr, + filter_mirror_set_vnet_hdr); + nfc->setup =3D filter_mirror_setup; nfc->cleanup =3D filter_mirror_cleanup; nfc->receive_iov =3D filter_mirror_receive_iov; @@ -383,6 +389,14 @@ static void filter_redirector_class_init(ObjectClass *= oc, void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 + object_class_property_add_str(oc, "indev", filter_redirector_get_indev, + filter_redirector_set_indev); + object_class_property_add_str(oc, "outdev", filter_redirector_get_outd= ev, + filter_redirector_set_outdev); + object_class_property_add_bool(oc, "vnet_hdr_support", + filter_redirector_get_vnet_hdr, + filter_redirector_set_vnet_hdr); + nfc->setup =3D filter_redirector_setup; nfc->cleanup =3D filter_redirector_cleanup; nfc->receive_iov =3D filter_redirector_receive_iov; @@ -392,28 +406,14 @@ static void filter_mirror_init(Object *obj) { MirrorState *s =3D FILTER_MIRROR(obj); =20 - object_property_add_str(obj, "outdev", filter_mirror_get_outdev, - filter_mirror_set_outdev); - s->vnet_hdr =3D false; - object_property_add_bool(obj, "vnet_hdr_support", - filter_mirror_get_vnet_hdr, - filter_mirror_set_vnet_hdr); } =20 static void filter_redirector_init(Object *obj) { MirrorState *s =3D FILTER_REDIRECTOR(obj); =20 - object_property_add_str(obj, "indev", filter_redirector_get_indev, - filter_redirector_set_indev); - object_property_add_str(obj, "outdev", filter_redirector_get_outdev, - filter_redirector_set_outdev); - s->vnet_hdr =3D false; - object_property_add_bool(obj, "vnet_hdr_support", - filter_redirector_get_vnet_hdr, - filter_redirector_set_vnet_hdr); } =20 static void filter_mirror_fini(Object *obj) diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c index dc3c27a489..ae358059d9 100644 --- a/net/filter-rewriter.c +++ b/net/filter-rewriter.c @@ -416,15 +416,16 @@ static void filter_rewriter_init(Object *obj) =20 s->vnet_hdr =3D false; s->failover_mode =3D FAILOVER_MODE_OFF; - object_property_add_bool(obj, "vnet_hdr_support", - filter_rewriter_get_vnet_hdr, - filter_rewriter_set_vnet_hdr); } =20 static void colo_rewriter_class_init(ObjectClass *oc, void *data) { NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 + object_class_property_add_bool(oc, "vnet_hdr_support", + filter_rewriter_get_vnet_hdr, + filter_rewriter_set_vnet_hdr); + nfc->setup =3D colo_rewriter_setup; nfc->cleanup =3D colo_rewriter_cleanup; nfc->receive_iov =3D colo_rewriter_receive_iov; diff --git a/net/filter.c b/net/filter.c index eac8ba1e9c..3fe88fa43f 100644 --- a/net/filter.c +++ b/net/filter.c @@ -212,18 +212,6 @@ static void netfilter_init(Object *obj) nf->on =3D true; nf->insert_before_flag =3D false; nf->position =3D g_strdup("tail"); - - object_property_add_str(obj, "netdev", - netfilter_get_netdev_id, netfilter_set_netdev_= id); - object_property_add_enum(obj, "queue", "NetFilterDirection", - &NetFilterDirection_lookup, - netfilter_get_direction, netfilter_set_direct= ion); - object_property_add_str(obj, "status", - netfilter_get_status, netfilter_set_status); - object_property_add_str(obj, "position", - netfilter_get_position, netfilter_set_position= ); - object_property_add_str(obj, "insert", - netfilter_get_insert, netfilter_set_insert); } =20 static void netfilter_complete(UserCreatable *uc, Error **errp) @@ -350,6 +338,18 @@ static void netfilter_class_init(ObjectClass *oc, void= *data) UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); NetFilterClass *nfc =3D NETFILTER_CLASS(oc); =20 + object_class_property_add_str(oc, "netdev", + netfilter_get_netdev_id, netfilter_set_n= etdev_id); + object_class_property_add_enum(oc, "queue", "NetFilterDirection", + &NetFilterDirection_lookup, + netfilter_get_direction, netfilter_set_= direction); + object_class_property_add_str(oc, "status", + netfilter_get_status, netfilter_set_stat= us); + object_class_property_add_str(oc, "position", + netfilter_get_position, netfilter_set_po= sition); + object_class_property_add_str(oc, "insert", + netfilter_get_insert, netfilter_set_inse= rt); + ucc->complete =3D netfilter_complete; nfc->handle_event =3D default_handle_event; } --=20 2.28.0 From nobody Thu May 16 10:35:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605120245; cv=none; d=zohomail.com; s=zohoarc; b=IcgvWAC5hMDa89hG7GRhPRTXXOir3A9wS+jeR83GgLgR9T72nUfClip01hU67j6ndYfNqUSP0+0Wc87OgikYfz9vsaJIisyqlB/FvfBaEY1As+qslywePNgcr3QbpSOqAaEo7mDk4g+kbv3eFmB05eWpOdaaSr8OiOpA4AjmsUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605120245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vTQvQV3EldUR5MCeiXq/dAUZUOCFSg1ml0s83cmdU40=; b=CL57Kt7W2tv/R/i9CB/aweSLc/pgE4zYQuxQUiwC6P8DRZdOSYQICG2MsyWqYNbCWNh7JNRGiIkUbmesa1skQVkxt5EJnVjH//UT5nUAgBqgJW1SlvVdjsTPCildnIBduJnGpzcRBBULwinu67SnFxuzpo+X0mjalb8MhN3SkVI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605120245623774.9975800205331; Wed, 11 Nov 2020 10:44:05 -0800 (PST) Received: from localhost ([::1]:41652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcv6C-0005DG-E5 for importer@patchew.org; Wed, 11 Nov 2020 13:44:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcv1E-0000PA-G6 for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:52783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kcv1B-00084q-5G for qemu-devel@nongnu.org; Wed, 11 Nov 2020 13:38:55 -0500 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-274--nQ4SyhPNjOXtiuDJ9_cIA-1; Wed, 11 Nov 2020 13:38:45 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14157186DD44 for ; Wed, 11 Nov 2020 18:38:45 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC4BB7366E; Wed, 11 Nov 2020 18:38:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605119928; 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=vTQvQV3EldUR5MCeiXq/dAUZUOCFSg1ml0s83cmdU40=; b=iKi+pRsQJZZzMfxROzjfPxwbHYinF4xgaj/8bFGV3u8pk4s9udBRTp8iEdGqqcpYLfM8az sqJb8E3/WyBElbCGZcvOQ05HinOZkhztef4k1L1qJg+f17VnhINBWX9zZv3YUCbC0kstAD 0CCgy+jNC3lbm2GhJmYKKkeNuKepD3o= X-MC-Unique: -nQ4SyhPNjOXtiuDJ9_cIA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH v2 12/12] input: Use class properties Date: Wed, 11 Nov 2020 13:38:23 -0500 Message-Id: <20201111183823.283752-13-ehabkost@redhat.com> In-Reply-To: <20201111183823.283752-1-ehabkost@redhat.com> References: <20201111183823.283752-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 01:42:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , "Daniel P. Berrange" , Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instance properties make introspection hard and are not shown by "-object ...,help". Convert them to class properties. Signed-off-by: Eduardo Habkost --- This was originally submitted as part of the series: Subject: [PATCH 00/12] qom: Make all -object types use only class properties Message-Id: <20201009160122.1662082-1-ehabkost@redhat.com> https://lore.kernel.org/qemu-devel/20201009160122.1662082-1-ehabkost@redhat= .com --- Cc: Gerd Hoffmann Cc: qemu-devel@nongnu.org --- ui/input-barrier.c | 22 ++++++++++++++++++++++ ui/input-linux.c | 14 ++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/ui/input-barrier.c b/ui/input-barrier.c index 81b8d04ec8..b3558c3c91 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -695,6 +695,28 @@ static void input_barrier_class_init(ObjectClass *oc, = void *data) { UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 + object_class_property_add_str(oc, "name", + input_barrier_get_name, + input_barrier_set_name); + object_class_property_add_str(oc, "server", + input_barrier_get_server, + input_barrier_set_server); + object_class_property_add_str(oc, "port", + input_barrier_get_port, + input_barrier_set_port); + object_class_property_add_str(oc, "x-origin", + input_barrier_get_x_origin, + input_barrier_set_x_origin); + object_class_property_add_str(oc, "y-origin", + input_barrier_get_y_origin, + input_barrier_set_y_origin); + object_class_property_add_str(oc, "width", + input_barrier_get_width, + input_barrier_set_width); + object_class_property_add_str(oc, "height", + input_barrier_get_height, + input_barrier_set_height); + ucc->complete =3D input_barrier_complete; =20 object_class_property_add_str(oc, "name", diff --git a/ui/input-linux.c b/ui/input-linux.c index 05c0c98819..1aaaa5a375 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -496,6 +496,20 @@ static void input_linux_class_init(ObjectClass *oc, vo= id *data) { UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); =20 + object_class_property_add_str(oc, "evdev", + input_linux_get_evdev, + input_linux_set_evdev); + object_class_property_add_bool(oc, "grab_all", + input_linux_get_grab_all, + input_linux_set_grab_all); + object_class_property_add_bool(oc, "repeat", + input_linux_get_repeat, + input_linux_set_repeat); + object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", + &GrabToggleKeys_lookup, + input_linux_get_grab_toggle, + input_linux_set_grab_toggle); + ucc->complete =3D input_linux_complete; =20 object_class_property_add_str(oc, "evdev", --=20 2.28.0