From nobody Mon Apr 29 09:25:52 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=1600813727; cv=none; d=zohomail.com; s=zohoarc; b=aKbUA/dWf7Nns5PEwQmqJEKSkLUfhEIqfShzWPU6SCr3W8G/4FoesQfDlqsGSE6xCvzAjvzYQgjhwgfl5+oYGJZFIscIvUVPNTzG6/OehwAI0meivtr4dgzJwPWYQFia3BII+umCRiWEkQIP7YpNISa6ZlI5Xx08KzAo+t/d83g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813727; 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=7bQerftuqLCTQanJ6CDpzCHEgRIQUKAVRHQRaWDW4zA=; b=gmkom46umYUs0OHl+WpqcHo4cJrAru5zyeFP89z4+SFyQOGcCiG/vlAibVMZfNx0vs6CNWFSHYyJQsNUY5PMFxhlMCRWb3voHvTz2NyILh016QlmrldS9ZvM2EJ0n18oh5PhD21BS4xgrZC0EU9JcgJlFCo4jGG9QdFNK+2RCME= 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 1600813727721617.2250600107682; Tue, 22 Sep 2020 15:28:47 -0700 (PDT) Received: from localhost ([::1]:41304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqmE-0002fc-9A for importer@patchew.org; Tue, 22 Sep 2020 18:28:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjW-000887-TZ for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:25:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjR-0006F7-Pz for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:25:58 -0400 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-524-85xp8tZSOxeh8pniQJrNPA-1; Tue, 22 Sep 2020 18:25:45 -0400 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 F3E4E1005E64; Tue, 22 Sep 2020 22:25:44 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88B1E2C31E; Tue, 22 Sep 2020 22:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813548; 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=7bQerftuqLCTQanJ6CDpzCHEgRIQUKAVRHQRaWDW4zA=; b=huD3kL2hsijvnRiM4doLQKCSBUORXbJ0gmwELVJjz0q9Cn03WFRtLeNkvBD3Z6fK3OIP4P xB8vq8VOwSXCQDmPTMoJhxfu0ItjExSvx2CLTjHqR3UcqPfkKymarINUrbRh8UTsB6tIA1 Dq0DSTMPhoqxC7m8MwLNPg7/Ir5IOj8= X-MC-Unique: 85xp8tZSOxeh8pniQJrNPA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 01/11] qom: simplify object_find_property / object_class_find_property Date: Tue, 22 Sep 2020 18:25:32 -0400 Message-Id: <20200922222542.2354748-2-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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-Type: text/plain; charset="utf-8" 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/09/22 02:07:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Daniel P. Berrang=C3=A9 When debugging QEMU it is often useful to put a breakpoint on the error_setg_internal method impl. Unfortunately the object_property_add / object_class_property_add methods call object_property_find / object_class_property_find methods to check if a property exists already before adding the new property. As a result there are a huge number of calls to error_setg_internal on startup of most QEMU commands, making it very painful to set a breakpoint on this method. Most callers of object_find_property and object_class_find_property, however, pass in a NULL for the Error parameter. This simplifies the methods to remove the Error parameter entirely, and then adds some new wrapper methods that are able to raise an Error when needed. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200914135617.1493072-1-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 48 ++++++++++++++++++++++--- hw/arm/armv7m.c | 10 +++--- hw/arm/exynos4210.c | 2 +- hw/arm/highbank.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/realview.c | 2 +- hw/arm/sbsa-ref.c | 2 +- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 4 +-- hw/arm/virt.c | 10 +++--- hw/arm/xilinx_zynq.c | 2 +- hw/core/qdev-properties-system.c | 2 +- hw/core/sysbus.c | 2 +- hw/cpu/a15mpcore.c | 4 +-- hw/cpu/a9mpcore.c | 2 +- hw/misc/iotkit-sysctl.c | 2 +- hw/pci/pci.c | 2 +- hw/scsi/scsi-bus.c | 4 +-- qom/object.c | 60 +++++++++++++++++++------------- target/arm/monitor.c | 2 +- target/i386/cpu.c | 2 +- target/ppc/translate_init.c.inc | 2 +- 22 files changed, 109 insertions(+), 61 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 19cccd3f5f7..9b018887266 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1463,14 +1463,52 @@ void object_property_set_default_uint(ObjectPropert= y *prop, uint64_t value); * object_property_find: * @obj: the object * @name: the name of the property + * + * Look up a property for an object. + * + * Return its #ObjectProperty if found, or NULL. + */ +ObjectProperty *object_property_find(Object *obj, const char *name); + +/** + * object_property_find_err: + * @obj: the object + * @name: the name of the property * @errp: returns an error if this function fails * - * Look up a property for an object and return its #ObjectProperty if foun= d. + * Look up a property for an object. + * + * Return its #ObjectProperty if found, or NULL. */ -ObjectProperty *object_property_find(Object *obj, const char *name, - Error **errp); -ObjectProperty *object_class_property_find(ObjectClass *klass, const char = *name, - Error **errp); +ObjectProperty *object_property_find_err(Object *obj, + const char *name, + Error **errp); + +/** + * object_class_property_find: + * @klass: the object class + * @name: the name of the property + * + * Look up a property for an object class. + * + * Return its #ObjectProperty if found, or NULL. + */ +ObjectProperty *object_class_property_find(ObjectClass *klass, + const char *name); + +/** + * object_class_property_find_err: + * @klass: the object class + * @name: the name of the property + * @errp: returns an error if this function fails + * + * Look up a property for an object class. + * + * Return its #ObjectProperty if found, or NULL. + */ +ObjectProperty *object_class_property_find_err(ObjectClass *klass, + const char *name, + Error **errp); =20 typedef struct ObjectPropertyIterator { ObjectClass *nextclass; diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index aa831d6653c..0e5997d333a 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -169,28 +169,28 @@ static void armv7m_realize(DeviceState *dev, Error **= errp) =20 object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->containe= r), &error_abort); - if (object_property_find(OBJECT(s->cpu), "idau", NULL)) { + if (object_property_find(OBJECT(s->cpu), "idau")) { object_property_set_link(OBJECT(s->cpu), "idau", s->idau, &error_abort); } - if (object_property_find(OBJECT(s->cpu), "init-svtor", NULL)) { + if (object_property_find(OBJECT(s->cpu), "init-svtor")) { if (!object_property_set_uint(OBJECT(s->cpu), "init-svtor", s->init_svtor, errp)) { return; } } - if (object_property_find(OBJECT(s->cpu), "start-powered-off", NULL)) { + if (object_property_find(OBJECT(s->cpu), "start-powered-off")) { if (!object_property_set_bool(OBJECT(s->cpu), "start-powered-off", s->start_powered_off, errp)) { return; } } - if (object_property_find(OBJECT(s->cpu), "vfp", NULL)) { + if (object_property_find(OBJECT(s->cpu), "vfp")) { if (!object_property_set_bool(OBJECT(s->cpu), "vfp", s->vfp, errp)= ) { return; } } - if (object_property_find(OBJECT(s->cpu), "dsp", NULL)) { + if (object_property_find(OBJECT(s->cpu), "dsp")) { if (!object_property_set_bool(OBJECT(s->cpu), "dsp", s->dsp, errp)= ) { return; } diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 081bbff3170..ced2769b102 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -214,7 +214,7 @@ static void exynos4210_realize(DeviceState *socdev, Err= or **errp) /* By default A9 CPUs have EL3 enabled. This board does not curre= ntly * support EL3 so the CPU EL3 property is disabled before realizat= ion. */ - if (object_property_find(cpuobj, "has_el3", NULL)) { + if (object_property_find(cpuobj, "has_el3")) { object_property_set_bool(cpuobj, "has_el3", false, &error_fata= l); } =20 diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index 7da984171bb..da0510d7cef 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -276,7 +276,7 @@ static void calxeda_init(MachineState *machine, enum cx= machines machine_id) &error_abort); } =20 - if (object_property_find(cpuobj, "reset-cbar", NULL)) { + if (object_property_find(cpuobj, "reset-cbar")) { object_property_set_int(cpuobj, "reset-cbar", MPCORE_PERIPHBAS= E, &error_abort); } diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index de670b08a90..16e89859539 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -603,7 +603,7 @@ static void integratorcp_init(MachineState *machine) * currently support EL3 so the CPU EL3 property is disabled before * realization. */ - if (object_property_find(cpuobj, "has_el3", NULL)) { + if (object_property_find(cpuobj, "has_el3")) { object_property_set_bool(cpuobj, "has_el3", false, &error_fatal); } =20 diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 5f1f36b15cd..0831159d158 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -108,7 +108,7 @@ static void realview_init(MachineState *machine, * does not currently support EL3 so the CPU EL3 property is disab= led * before realization. */ - if (object_property_find(cpuobj, "has_el3", NULL)) { + if (object_property_find(cpuobj, "has_el3")) { object_property_set_bool(cpuobj, "has_el3", false, &error_fata= l); } =20 diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index bcb2cb47619..257ada94255 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -703,7 +703,7 @@ static void sbsa_ref_init(MachineState *machine) numa_cpu_pre_plug(&possible_cpus->cpus[cs->cpu_index], DEVICE(cpuo= bj), &error_fatal); =20 - if (object_property_find(cpuobj, "reset-cbar", NULL)) { + if (object_property_find(cpuobj, "reset-cbar")) { object_property_set_int(cpuobj, "reset-cbar", sbsa_ref_memmap[SBSA_CPUPERIPHS].base, &error_abort); diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 84d4677abb7..1ea55346264 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -213,7 +213,7 @@ static void versatile_init(MachineState *machine, int b= oard_id) * currently support EL3 so the CPU EL3 property is disabled before * realization. */ - if (object_property_find(cpuobj, "has_el3", NULL)) { + if (object_property_find(cpuobj, "has_el3")) { object_property_set_bool(cpuobj, "has_el3", false, &error_fatal); } =20 diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 94ff094ab3e..531f3a122ad 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -218,12 +218,12 @@ static void init_cpus(MachineState *ms, const char *c= pu_type, object_property_set_bool(cpuobj, "has_el3", false, NULL); } if (!virt) { - if (object_property_find(cpuobj, "has_el2", NULL)) { + if (object_property_find(cpuobj, "has_el2")) { object_property_set_bool(cpuobj, "has_el2", false, NULL); } } =20 - if (object_property_find(cpuobj, "reset-cbar", NULL)) { + if (object_property_find(cpuobj, "reset-cbar")) { object_property_set_int(cpuobj, "reset-cbar", periphbase, &error_abort); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index acf9bfbecea..1231a197c85 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1806,7 +1806,7 @@ static void machvirt_init(MachineState *machine) object_property_set_bool(cpuobj, "has_el3", false, NULL); } =20 - if (!vms->virt && object_property_find(cpuobj, "has_el2", NULL)) { + if (!vms->virt && object_property_find(cpuobj, "has_el2")) { object_property_set_bool(cpuobj, "has_el2", false, NULL); } =20 @@ -1822,15 +1822,15 @@ static void machvirt_init(MachineState *machine) } =20 if (vmc->kvm_no_adjvtime && - object_property_find(cpuobj, "kvm-no-adjvtime", NULL)) { + object_property_find(cpuobj, "kvm-no-adjvtime")) { object_property_set_bool(cpuobj, "kvm-no-adjvtime", true, NULL= ); } =20 - if (vmc->no_pmu && object_property_find(cpuobj, "pmu", NULL)) { + if (vmc->no_pmu && object_property_find(cpuobj, "pmu")) { object_property_set_bool(cpuobj, "pmu", false, NULL); } =20 - if (object_property_find(cpuobj, "reset-cbar", NULL)) { + if (object_property_find(cpuobj, "reset-cbar")) { object_property_set_int(cpuobj, "reset-cbar", vms->memmap[VIRT_CPUPERIPHS].base, &error_abort); @@ -1850,7 +1850,7 @@ static void machvirt_init(MachineState *machine) * The property exists only if MemTag is supported. * If it is, we must allocate the ram to back that up. */ - if (!object_property_find(cpuobj, "tag-memory", NULL)) { + if (!object_property_find(cpuobj, "tag-memory")) { error_report("MTE requested, but not supported " "by the guest CPU"); exit(1); diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index 2c0bff4fa6c..b72772bc824 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -196,7 +196,7 @@ static void zynq_init(MachineState *machine) * currently support EL3 so the CPU EL3 property is disabled before * realization. */ - if (object_property_find(OBJECT(cpu), "has_el3", NULL)) { + if (object_property_find(OBJECT(cpu), "has_el3")) { object_property_set_bool(OBJECT(cpu), "has_el3", false, &error_fat= al); } =20 diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 3e4f16fc218..b29daf4fb51 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -460,7 +460,7 @@ void qdev_set_nic_properties(DeviceState *dev, NICInfo = *nd) qdev_prop_set_netdev(dev, "netdev", nd->netdev); } if (nd->nvectors !=3D DEV_NVECTORS_UNSPECIFIED && - object_property_find(OBJECT(dev), "vectors", NULL)) { + object_property_find(OBJECT(dev), "vectors")) { qdev_prop_set_uint32(dev, "vectors", nd->nvectors); } nd->instantiated =3D 1; diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 294f90b7dee..68e8dc88c5c 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -93,7 +93,7 @@ bool sysbus_has_irq(SysBusDevice *dev, int n) char *prop =3D g_strdup_printf("%s[%d]", SYSBUS_DEVICE_GPIO_IRQ, n); ObjectProperty *r; =20 - r =3D object_property_find(OBJECT(dev), prop, NULL); + r =3D object_property_find(OBJECT(dev), prop); g_free(prop); =20 return (r !=3D NULL); diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index c377be398d1..774ca9987a1 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -66,11 +66,11 @@ static void a15mp_priv_realize(DeviceState *dev, Error = **errp) * either all the CPUs have TZ, or none do. */ cpuobj =3D OBJECT(qemu_get_cpu(0)); - has_el3 =3D object_property_find(cpuobj, "has_el3", NULL) && + has_el3 =3D object_property_find(cpuobj, "has_el3") && object_property_get_bool(cpuobj, "has_el3", &error_abort); qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3); /* Similarly for virtualization support */ - has_el2 =3D object_property_find(cpuobj, "has_el2", NULL) && + has_el2 =3D object_property_find(cpuobj, "has_el2") && object_property_get_bool(cpuobj, "has_el2", &error_abort); qdev_prop_set_bit(gicdev, "has-virtualization-extensions", has_el2= ); } diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c index ec186d49abd..d03f57e579b 100644 --- a/hw/cpu/a9mpcore.c +++ b/hw/cpu/a9mpcore.c @@ -81,7 +81,7 @@ static void a9mp_priv_realize(DeviceState *dev, Error **e= rrp) /* Make the GIC's TZ support match the CPUs. We assume that * either all the CPUs have TZ, or none do. */ - has_el3 =3D object_property_find(cpuobj, "has_el3", NULL) && + has_el3 =3D object_property_find(cpuobj, "has_el3") && object_property_get_bool(cpuobj, "has_el3", &error_abort); qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3); =20 diff --git a/hw/misc/iotkit-sysctl.c b/hw/misc/iotkit-sysctl.c index 269783366d1..964b48c74d9 100644 --- a/hw/misc/iotkit-sysctl.c +++ b/hw/misc/iotkit-sysctl.c @@ -83,7 +83,7 @@ static void set_init_vtor(uint64_t cpuid, uint32_t vtor) Object *cpuobj =3D OBJECT(arm_get_cpu_by_id(cpuid)); =20 if (cpuobj) { - if (object_property_find(cpuobj, "init-svtor", NULL)) { + if (object_property_find(cpuobj, "init-svtor")) { object_property_set_uint(cpuobj, "init-svtor", vtor, &error_ab= ort); } } diff --git a/hw/pci/pci.c b/hw/pci/pci.c index de0fae10ab9..fce725474b9 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1900,7 +1900,7 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *r= ootbus, * a temporary instance here to be able to check it. */ Object *obj =3D object_new_with_class(OBJECT_CLASS(dc)); - if (object_property_find(obj, "netdev", NULL)) { + if (object_property_find(obj, "netdev")) { g_ptr_array_add(pci_nic_models, (gpointer)name); } object_unref(obj); diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index df65cc22239..3284a5d1fb6 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -270,10 +270,10 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, B= lockBackend *blk, object_property_set_int(OBJECT(dev), "bootindex", bootindex, &error_abort); } - if (object_property_find(OBJECT(dev), "removable", NULL)) { + if (object_property_find(OBJECT(dev), "removable")) { qdev_prop_set_bit(dev, "removable", removable); } - if (serial && object_property_find(OBJECT(dev), "serial", NULL)) { + if (serial && object_property_find(OBJECT(dev), "serial")) { qdev_prop_set_string(dev, "serial", serial); } if (!qdev_prop_set_drive_err(dev, "drive", blk, errp)) { diff --git a/qom/object.c b/qom/object.c index a91a6a515af..a1ab9a78011 100644 --- a/qom/object.c +++ b/qom/object.c @@ -403,7 +403,7 @@ bool object_apply_global_props(Object *obj, const GPtrA= rray *props, if (object_dynamic_cast(obj, p->driver) =3D=3D NULL) { continue; } - if (p->optional && !object_property_find(obj, p->property, NULL)) { + if (p->optional && !object_property_find(obj, p->property)) { continue; } p->used =3D true; @@ -1214,7 +1214,7 @@ object_property_try_add(Object *obj, const char *name= , const char *type, return ret; } =20 - if (object_property_find(obj, name, NULL) !=3D NULL) { + if (object_property_find(obj, name) !=3D NULL) { error_setg(errp, "attempt to add duplicate property '%s' to object= (type '%s')", name, object_get_typename(obj)); return NULL; @@ -1256,7 +1256,7 @@ object_class_property_add(ObjectClass *klass, { ObjectProperty *prop; =20 - assert(!object_class_property_find(klass, name, NULL)); + assert(!object_class_property_find(klass, name)); =20 prop =3D g_malloc0(sizeof(*prop)); =20 @@ -1273,24 +1273,27 @@ object_class_property_add(ObjectClass *klass, return prop; } =20 -ObjectProperty *object_property_find(Object *obj, const char *name, - Error **errp) +ObjectProperty *object_property_find(Object *obj, const char *name) { ObjectProperty *prop; ObjectClass *klass =3D object_get_class(obj); =20 - prop =3D object_class_property_find(klass, name, NULL); + prop =3D object_class_property_find(klass, name); if (prop) { return prop; } =20 - prop =3D g_hash_table_lookup(obj->properties, name); - if (prop) { - return prop; - } + return g_hash_table_lookup(obj->properties, name); +} =20 - error_setg(errp, "Property '.%s' not found", name); - return NULL; +ObjectProperty *object_property_find_err(Object *obj, const char *name, + Error **errp) +{ + ObjectProperty *prop =3D object_property_find(obj, name); + if (!prop) { + error_setg(errp, "Property '.%s' not found", name); + } + return prop; } =20 void object_property_iter_init(ObjectPropertyIterator *iter, @@ -1320,27 +1323,34 @@ void object_class_property_iter_init(ObjectProperty= Iterator *iter, iter->nextclass =3D object_class_get_parent(klass); } =20 -ObjectProperty *object_class_property_find(ObjectClass *klass, const char = *name, - Error **errp) +ObjectProperty *object_class_property_find(ObjectClass *klass, const char = *name) { - ObjectProperty *prop; ObjectClass *parent_klass; =20 parent_klass =3D object_class_get_parent(klass); if (parent_klass) { - prop =3D object_class_property_find(parent_klass, name, NULL); + ObjectProperty *prop =3D + object_class_property_find(parent_klass, name); if (prop) { return prop; } } =20 - prop =3D g_hash_table_lookup(klass->properties, name); + return g_hash_table_lookup(klass->properties, name); +} + +ObjectProperty *object_class_property_find_err(ObjectClass *klass, + const char *name, + Error **errp) +{ + ObjectProperty *prop =3D object_class_property_find(klass, name); if (!prop) { error_setg(errp, "Property '.%s' not found", name); } return prop; } =20 + void object_property_del(Object *obj, const char *name) { ObjectProperty *prop =3D g_hash_table_lookup(obj->properties, name); @@ -1355,7 +1365,7 @@ bool object_property_get(Object *obj, const char *nam= e, Visitor *v, Error **errp) { Error *err =3D NULL; - ObjectProperty *prop =3D object_property_find(obj, name, errp); + ObjectProperty *prop =3D object_property_find_err(obj, name, errp); =20 if (prop =3D=3D NULL) { return false; @@ -1374,7 +1384,7 @@ bool object_property_set(Object *obj, const char *nam= e, Visitor *v, Error **errp) { Error *err =3D NULL; - ObjectProperty *prop =3D object_property_find(obj, name, errp); + ObjectProperty *prop =3D object_property_find_err(obj, name, errp); =20 if (prop =3D=3D NULL) { return false; @@ -1590,7 +1600,7 @@ int object_property_get_enum(Object *obj, const char = *name, { char *str; int ret; - ObjectProperty *prop =3D object_property_find(obj, name, errp); + ObjectProperty *prop =3D object_property_find_err(obj, name, errp); EnumProperty *enumprop; =20 if (prop =3D=3D NULL) { @@ -1647,7 +1657,7 @@ out: =20 const char *object_property_get_type(Object *obj, const char *name, Error = **errp) { - ObjectProperty *prop =3D object_property_find(obj, name, errp); + ObjectProperty *prop =3D object_property_find_err(obj, name, errp); if (prop =3D=3D NULL) { return NULL; } @@ -2025,7 +2035,7 @@ char *object_get_canonical_path(const Object *obj) =20 Object *object_resolve_path_component(Object *parent, const char *part) { - ObjectProperty *prop =3D object_property_find(parent, part, NULL); + ObjectProperty *prop =3D object_property_find(parent, part); if (prop =3D=3D NULL) { return NULL; } @@ -2724,8 +2734,8 @@ object_property_add_alias(Object *obj, const char *na= me, ObjectProperty *target_prop; g_autofree char *prop_type =3D NULL; =20 - target_prop =3D object_property_find(target_obj, target_name, - &error_abort); + target_prop =3D object_property_find_err(target_obj, target_name, + &error_abort); =20 if (object_property_is_child(target_prop)) { prop_type =3D g_strdup_printf("link%s", @@ -2758,7 +2768,7 @@ void object_property_set_description(Object *obj, con= st char *name, { ObjectProperty *op; =20 - op =3D object_property_find(obj, name, &error_abort); + op =3D object_property_find_err(obj, name, &error_abort); g_free(op->description); op->description =3D g_strdup(description); } diff --git a/target/arm/monitor.c b/target/arm/monitor.c index ba6e01abd03..375f34bfaa7 100644 --- a/target/arm/monitor.c +++ b/target/arm/monitor.c @@ -214,7 +214,7 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(Cp= uModelExpansionType type, =20 i =3D 0; while ((name =3D cpu_model_advertised_features[i++]) !=3D NULL) { - ObjectProperty *prop =3D object_property_find(obj, name, NULL); + ObjectProperty *prop =3D object_property_find(obj, name); if (prop) { QObject *value; =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1c58f764dcb..3ffd877dd51 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6828,7 +6828,7 @@ static void x86_cpu_register_bit_prop(X86CPU *cpu, ObjectProperty *op; uint64_t mask =3D (1ULL << bitnr); =20 - op =3D object_property_find(OBJECT(cpu), prop_name, NULL); + op =3D object_property_find(OBJECT(cpu), prop_name); if (op) { fp =3D op->opaque; assert(fp->w =3D=3D w); diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.= inc index accb4f2faea..bb66526280e 100644 --- a/target/ppc/translate_init.c.inc +++ b/target/ppc/translate_init.c.inc @@ -10478,7 +10478,7 @@ static void ppc_cpu_parse_featurestr(const char *ty= pe, char *features, return; } =20 - if (object_property_find(machine, "max-cpu-compat", NULL)) { + if (object_property_find(machine, "max-cpu-compat")) { int i; char **inpieces; char *s =3D features; --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813799; cv=none; d=zohomail.com; s=zohoarc; b=LZpjo0U6v3bDC52Da8OJP1mXxv44ANTU6m8KwXlv2LQcUB+gW61TO+ru8VzhJDjiJilF36R/qAtFUGD8e94I+Wn8mM46mj4R1NQNdWjSKIqkC5dYqzSjjRaFCCh1Bj8W3j6ktLIWBQu/BODenBA9XUEAQ5jfMUHzKBvG2qcCp+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813799; 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=sshdCAIf6yyO+YtiRE/5dt5hehEhv4t10cIzRyBR+3A=; b=LAQKgLq5zQtjA+iL0j4PHEXDQzCu6aGefFhoURAChLNVKYuRi5ZAkDwGFoObKwWsxzHDKsFGWHfy3SvdCM6z2t6LwBCINELOvw7mwbCllLIKg6DvgMVMQlgJaDow2eFbdo44j1Kg6Nh0yTIp2Cyib44mpMc0beh4edZuiCWsEWI= 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 1600813799703938.2793098253825; Tue, 22 Sep 2020 15:29:59 -0700 (PDT) Received: from localhost ([::1]:46244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqnO-0004ew-CE for importer@patchew.org; Tue, 22 Sep 2020 18:29:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjV-00084s-Bd for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:25:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31043 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjR-0006GH-P1 for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:25:57 -0400 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-436-PbRSJxslOSuPaVxKPBOqqQ-1; Tue, 22 Sep 2020 18:25:47 -0400 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 079961084D6E; Tue, 22 Sep 2020 22:25:46 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3C2673670; Tue, 22 Sep 2020 22:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813550; 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=sshdCAIf6yyO+YtiRE/5dt5hehEhv4t10cIzRyBR+3A=; b=WnxwU4OcRSZl9UYxu2+jVgE3yF27gES4/OnMngTy9kQuUPbCihVajdQycANLguZ4us5uLB hhWBgRaBsAMtZmqo9/h7Xzqf8gUATB+BO4eG4y0s527Z1FRnAfb0fKIi9L+o4kyyoQ2z3K djjWl7+tykr/6njLMdDD8YjGvM6x/6Y= X-MC-Unique: PbRSJxslOSuPaVxKPBOqqQ-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 02/11] smp: drop support for deprecated (invalid topologies) Date: Tue, 22 Sep 2020 18:25:33 -0400 Message-Id: <20200922222542.2354748-3-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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=205.139.110.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 13:33:09 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Igor Mammedov 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" From: Igor Mammedov it's was deprecated since 3.1 Support for invalid topologies is removed, the user must ensure that topologies described with -smp include all possible cpus, i.e. (sockets * cores * threads) =3D=3D maxcpus or QEMU will exit with error. Signed-off-by: Igor Mammedov Message-Id: <20200911133202.938754-1-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- docs/system/deprecated.rst | 26 +++++++++++++------------- hw/core/machine.c | 16 ++++------------ hw/i386/pc.c | 16 ++++------------ 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index 808c334fe74..fb95d2ecc4f 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -47,19 +47,6 @@ The 'file' driver for drives is no longer appropriate fo= r character or host devices and will only accept regular files (S_IFREG). The correct driver for these file types is 'host_cdrom' or 'host_device' as appropriate. =20 -``-smp`` (invalid topologies) (since 3.1) -''''''''''''''''''''''''''''''''''''''''' - -CPU topology properties should describe whole machine topology including -possible CPUs. - -However, historically it was possible to start QEMU with an incorrect topo= logy -where *n* <=3D *sockets* * *cores* * *threads* < *maxcpus*, -which could lead to an incorrect topology enumeration by the guest. -Support for invalid topologies will be removed, the user must ensure -topologies described with -smp include all possible cpus, i.e. -*sockets* * *cores* * *threads* =3D *maxcpus*. - ``-vnc acl`` (since 4.0.0) '''''''''''''''''''''''''' =20 @@ -642,6 +629,19 @@ New machine versions (since 5.1) will not accept the o= ption but it will still work with old machine types. User can check the QAPI schema to see if the = legacy option is supported by looking at MachineInfo::numa-mem-supported property. =20 +``-smp`` (invalid topologies) (removed 5.2) +''''''''''''''''''''''''''''''''''''''''''' + +CPU topology properties should describe whole machine topology including +possible CPUs. + +However, historically it was possible to start QEMU with an incorrect topo= logy +where *n* <=3D *sockets* * *cores* * *threads* < *maxcpus*, +which could lead to an incorrect topology enumeration by the guest. +Support for invalid topologies is removed, the user must ensure +topologies described with -smp include all possible cpus, i.e. +*sockets* * *cores* * *threads* =3D *maxcpus*. + Block devices ------------- =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index ea26d612374..09aee4ea52b 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -754,23 +754,15 @@ static void smp_parse(MachineState *ms, QemuOpts *opt= s) exit(1); } =20 - if (sockets * cores * threads > ms->smp.max_cpus) { - error_report("cpu topology: " - "sockets (%u) * cores (%u) * threads (%u) > " - "maxcpus (%u)", + if (sockets * cores * threads !=3D ms->smp.max_cpus) { + error_report("Invalid CPU topology: " + "sockets (%u) * cores (%u) * threads (%u) " + "!=3D maxcpus (%u)", sockets, cores, threads, ms->smp.max_cpus); exit(1); } =20 - if (sockets * cores * threads !=3D ms->smp.max_cpus) { - warn_report("Invalid CPU topology deprecated: " - "sockets (%u) * cores (%u) * threads (%u) " - "!=3D maxcpus (%u)", - sockets, cores, threads, - ms->smp.max_cpus); - } - ms->smp.cpus =3D cpus; ms->smp.cores =3D cores; ms->smp.threads =3D threads; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b55369357e5..1e2ab5ebe79 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -746,23 +746,15 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts) exit(1); } =20 - if (sockets * dies * cores * threads > ms->smp.max_cpus) { - error_report("cpu topology: " - "sockets (%u) * dies (%u) * cores (%u) * threads = (%u) > " - "maxcpus (%u)", + if (sockets * dies * cores * threads !=3D ms->smp.max_cpus) { + error_report("Invalid CPU topology deprecated: " + "sockets (%u) * dies (%u) * cores (%u) * threads = (%u) " + "!=3D maxcpus (%u)", sockets, dies, cores, threads, ms->smp.max_cpus); exit(1); } =20 - if (sockets * dies * cores * threads !=3D ms->smp.max_cpus) { - warn_report("Invalid CPU topology deprecated: " - "sockets (%u) * dies (%u) * cores (%u) * threads (= %u) " - "!=3D maxcpus (%u)", - sockets, dies, cores, threads, - ms->smp.max_cpus); - } - ms->smp.cpus =3D cpus; ms->smp.cores =3D cores; ms->smp.threads =3D threads; --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813800; cv=none; d=zohomail.com; s=zohoarc; b=fu7fwlkZEejEHQI4ZwcZw8n4VQsAGn1ZpZSlaub1kupw/p3dVl8IHjLANCbsFbMckA8Hn3llDN/ZGyr9McIs3IOmIzNORlrOWCxtWagPvhum2MWUKm13uaEUKBJ6LHlKnfO4btoTl0wXnnQb5W9Qm5NISPsYLFagPevH1OKPkLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813800; 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=zdEAwkWXGaIslq9BgQ9voSgKZZw+SQC6QvEj70bS2Xw=; b=YOJ8T95Hz0MEfoOi8pp3B5UrYL5WE5TIUj1iC4bOyjSNOsyYhPgQF73aaj62TF4Hm2NxYGN8hwsre3Gqs5UGViGPWC5wS0TZOcspFdaaFgimsbgW7a5RdzIXjYY0+JZyOpVcof8ZctxQXWwCq81T2b1aRk/eIM54wqMJ0TcR5SA= 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 1600813800475130.7019598681984; Tue, 22 Sep 2020 15:30:00 -0700 (PDT) Received: from localhost ([::1]:46344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqnO-0004hS-Vf for importer@patchew.org; Tue, 22 Sep 2020 18:29:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjV-00085D-Ny for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:25:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjR-0006GJ-PH for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:25:57 -0400 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-431-un9vauJ4OXawpmEjA0_RmA-1; Tue, 22 Sep 2020 18:25:48 -0400 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 331691084D6F; Tue, 22 Sep 2020 22:25:47 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id C437E10013DB; Tue, 22 Sep 2020 22:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813550; 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=zdEAwkWXGaIslq9BgQ9voSgKZZw+SQC6QvEj70bS2Xw=; b=I/t0F/KXTfiCfnCLhfdx/kwsqTKyge7KtsA+Xx2yCVOIDuXCIB7N6n+0cpCbf+sw5d1V4p ctQS4s8gFD0jacz1d4qZfoUp7CU8fK1LLDdGiaZEWChHz4wwPxV4qWZE1E7cSGnoa8r/0a B+v8BucgfvQGP/xNdwOukrasB6tBG7g= X-MC-Unique: un9vauJ4OXawpmEjA0_RmA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 03/11] cryptodev-vhost-user: Register "chardev" as class property Date: Tue, 22 Sep 2020 18:25:34 -0400 Message-Id: <20200922222542.2354748-4-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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=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/09/22 15:47:47 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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: Paolo Bonzini , Gonglei , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= 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: Gonglei Message-Id: <20200921221045.699690-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- backends/cryptodev-vhost-user.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-use= r.c index 60ec4908aa1..e1df073de2d 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -334,13 +334,6 @@ cryptodev_vhost_user_get_chardev(Object *obj, Error **= errp) return NULL; } =20 -static void cryptodev_vhost_user_instance_int(Object *obj) -{ - object_property_add_str(obj, "chardev", - cryptodev_vhost_user_get_chardev, - cryptodev_vhost_user_set_chardev); -} - static void cryptodev_vhost_user_finalize(Object *obj) { CryptoDevBackendVhostUser *s =3D @@ -361,13 +354,17 @@ cryptodev_vhost_user_class_init(ObjectClass *oc, void= *data) bc->create_session =3D cryptodev_vhost_user_sym_create_session; bc->close_session =3D cryptodev_vhost_user_sym_close_session; bc->do_sym_op =3D NULL; + + object_class_property_add_str(oc, "chardev", + cryptodev_vhost_user_get_chardev, + cryptodev_vhost_user_set_chardev); + } =20 static const TypeInfo cryptodev_vhost_user_info =3D { .name =3D TYPE_CRYPTODEV_BACKEND_VHOST_USER, .parent =3D TYPE_CRYPTODEV_BACKEND, .class_init =3D cryptodev_vhost_user_class_init, - .instance_init =3D cryptodev_vhost_user_instance_int, .instance_finalize =3D cryptodev_vhost_user_finalize, .instance_size =3D sizeof(CryptoDevBackendVhostUser), }; --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813685; cv=none; d=zohomail.com; s=zohoarc; b=WtHbNj3IvJcHzV1pwGAO0Frc/7iNlz5f7xD+UOlID0DHoJwjqzbzg6O7GZt0upcrJqeSHezWat4TDpF2KW0BxsxDr07MIQnnFfoLFqzK4DVkHD2UdpeDtxDwxbaBpUEbjzs8xcRIDSKpLQukt6stEfuAbChDUQFjG/eXnMGs8cY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813685; 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=CXtdQKUwHvz3rh44a8aQZf0c7eq1JEHgcSfgLdbVzx4=; b=Kakga6RG61M9TBUzpywg165zc4wjfpZEW3ftyl1snDjbO8td2HSEcrkTP+gZ6bOeADw/ToXnuOIBKN4ZnG46iaD0tntOxljnZhlmrWbagJjHfvhWO/4VOuwjC+U5pgooJWjRrQingvbwyOYdfilUe5egMd93UNi0eS9hi7xPIrY= 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 1600813685627884.3299445366918; Tue, 22 Sep 2020 15:28:05 -0700 (PDT) Received: from localhost ([::1]:37998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqlY-0001Ka-Bs for importer@patchew.org; Tue, 22 Sep 2020 18:28:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjU-00083t-6m for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:25:56 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:47812 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjR-0006Gr-QA for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:25:55 -0400 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-334-AXgf0teQMcWSKZTL9MX-zw-1; Tue, 22 Sep 2020 18:25:49 -0400 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 21715425DF; Tue, 22 Sep 2020 22:25:48 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2A0878805; Tue, 22 Sep 2020 22:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813551; 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=CXtdQKUwHvz3rh44a8aQZf0c7eq1JEHgcSfgLdbVzx4=; b=dVyYTbo89Ibv8cKQeUZsJUvc4MjtFd5oLMf4hGvFoQUYQ/EqNgigNUFxMro4nHraazsVtk eVbFdbSrfKLB8d2UB3qhJOIdmabs7n6SUqyH3ApBC1tCKJ6yPWFT15G7u3zzrmKOPW3OwY mr1nbbp8yvvhPIIUadxqUnok1iNXF9I= X-MC-Unique: AXgf0teQMcWSKZTL9MX-zw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 04/11] cryptodev-backend: Register "chardev" as class property Date: Tue, 22 Sep 2020 18:25:35 -0400 Message-Id: <20200922222542.2354748-5-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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=205.139.110.61; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 17:00:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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_H2=-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: Paolo Bonzini , Gonglei , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= 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: Gonglei Message-Id: <20200921221045.699690-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- backends/cryptodev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/cryptodev.c b/backends/cryptodev.c index ada4ebe78b1..3f141f61ed6 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -206,10 +206,6 @@ cryptodev_backend_can_be_deleted(UserCreatable *uc) =20 static void cryptodev_backend_instance_init(Object *obj) { - object_property_add(obj, "queues", "uint32", - cryptodev_backend_get_queues, - cryptodev_backend_set_queues, - NULL, NULL); /* Initialize devices' queues property to 1 */ object_property_set_int(obj, "queues", 1, NULL); } @@ -230,6 +226,10 @@ cryptodev_backend_class_init(ObjectClass *oc, void *da= ta) ucc->can_be_deleted =3D cryptodev_backend_can_be_deleted; =20 QTAILQ_INIT(&crypto_clients); + object_class_property_add(oc, "queues", "uint32", + cryptodev_backend_get_queues, + cryptodev_backend_set_queues, + NULL, NULL); } =20 static const TypeInfo cryptodev_backend_info =3D { --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813693; cv=none; d=zohomail.com; s=zohoarc; b=Qi9FdZCgu3AdpvtQkYjZKzFX6lk5oVnyiopezxMIz+xQZwbOYJqPD3M6MKAbt2hClcRydckyOxwjAxsT5hDEpAy5rv+ohBq1iWbxsJpw55n/lRNBUWKt0fhTILCcknkf6cotG5J29oFS3AEzrbCKrKyMfifwYqYs8+ibFblAQ/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813693; 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=qLySm8bIjgHhtZueEYh4yesmf1i/Wj497OLUEF9Hsyc=; b=GRBBZoPOweqv6CK0mfPHnfQh/U+5rLFMIy9miw/BJVOu4Hcnss17nZigVAZPSeD62hUS389Ld6+hv3phM+7Z8/5nxC2dxTjiZjU8fPFTpoK9NfrXgkfmUxjNwO7X2E3d2cbxh7ZmI4G0lSQWgNIDc8O0nri9fwhdxlbLa9rlqBM= 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 1600813693983190.24769237790588; Tue, 22 Sep 2020 15:28:13 -0700 (PDT) Received: from localhost ([::1]:38758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqlg-0001d6-G1 for importer@patchew.org; Tue, 22 Sep 2020 18:28:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjb-0008IL-Gj for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjZ-0006Ku-KU for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:03 -0400 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-50-iaPiE_nLO3mtWuTpsoZvuA-1; Tue, 22 Sep 2020 18:25:58 -0400 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 1D98B1084D6E; Tue, 22 Sep 2020 22:25:57 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21B535577A; Tue, 22 Sep 2020 22:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813560; 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=qLySm8bIjgHhtZueEYh4yesmf1i/Wj497OLUEF9Hsyc=; b=Urye5tGKocMbb8mc8uiEOIXhqRy9fdSJvyRWIs8CyOyNi+O3eerZDwLIRnTniSXl+QI1eI HN4jlcUhIdq4ISSL9eiEU/TqbHvtSIibfEW0ufISJm57aHVxBdCO9pQe+/6dPxoe25VeKR Qw+A4+/jKUKjHd03uWiRPvz+tavAYr0= X-MC-Unique: iaPiE_nLO3mtWuTpsoZvuA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 05/11] s390x: Register all CPU properties as class properties Date: Tue, 22 Sep 2020 18:25:36 -0400 Message-Id: <20200922222542.2354748-6-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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=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/09/22 02:07:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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: Paolo Bonzini , Cornelia Huck , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , David Hildenbrand 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: David Hildenbrand Acked-by: Cornelia Huck Message-Id: <20200921221045.699690-13-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- target/s390x/internal.h | 1 - target/s390x/cpu.c | 1 - target/s390x/cpu_models.c | 35 ++++++++++++++++------------------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/target/s390x/internal.h b/target/s390x/internal.h index b1e0ebf67f8..bac0d3c67b2 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -260,7 +260,6 @@ static inline void s390_cpu_unhalt(S390CPU *cpu) =20 =20 /* cpu_models.c */ -void s390_cpu_model_register_props(Object *obj); void s390_cpu_model_class_register_props(ObjectClass *oc); void s390_realize_cpu_model(CPUState *cs, Error **errp); ObjectClass *s390_cpu_class_by_name(const char *name); diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index e350edc9f53..9cbd937ba2c 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -302,7 +302,6 @@ static void s390_cpu_initfn(Object *obj) timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu); s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); #endif - s390_cpu_model_register_props(obj); } =20 static void s390_cpu_finalize(Object *obj) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index c2af2261743..b97e9596ab0 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -1089,25 +1089,6 @@ static void set_feature_group(Object *obj, Visitor *= v, const char *name, } } =20 -void s390_cpu_model_register_props(Object *obj) -{ - S390FeatGroup group; - S390Feat feat; - - for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { - const S390FeatDef *def =3D s390_feat_def(feat); - object_property_add(obj, def->name, "bool", get_feature, - set_feature, NULL, (void *) feat); - object_property_set_description(obj, def->name, def->desc); - } - for (group =3D 0; group < S390_FEAT_GROUP_MAX; group++) { - const S390FeatGroupDef *def =3D s390_feat_group_def(group); - object_property_add(obj, def->name, "bool", get_feature_group, - set_feature_group, NULL, (void *) group); - object_property_set_description(obj, def->name, def->desc); - } -} - static void s390_cpu_model_initfn(Object *obj) { S390CPU *cpu =3D S390_CPU(obj); @@ -1215,11 +1196,27 @@ static char *get_description(Object *obj, Error **e= rrp) =20 void s390_cpu_model_class_register_props(ObjectClass *oc) { + S390FeatGroup group; + S390Feat feat; + object_class_property_add_bool(oc, "migration-safe", get_is_migration_= safe, NULL); object_class_property_add_bool(oc, "static", get_is_static, NULL); object_class_property_add_str(oc, "description", get_description, NULL= ); + + for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { + const S390FeatDef *def =3D s390_feat_def(feat); + object_class_property_add(oc, def->name, "bool", get_feature, + set_feature, NULL, (void *) feat); + object_class_property_set_description(oc, def->name, def->desc); + } + for (group =3D 0; group < S390_FEAT_GROUP_MAX; group++) { + const S390FeatGroupDef *def =3D s390_feat_group_def(group); + object_class_property_add(oc, def->name, "bool", get_feature_group, + set_feature_group, NULL, (void *) group); + object_class_property_set_description(oc, def->name, def->desc); + } } =20 #ifdef CONFIG_KVM --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813878; cv=none; d=zohomail.com; s=zohoarc; b=POZfkz2JK3Xq7A4NUJfcjKjON1+RdSH7If7B7QBhfGsisrgYuZIrNdrV2OMVBS8fDCocEUWs1fJmVPIQQq8bgDogrAwxvJJr2f+4UqBoAyCzClU+CPcnNOlGTerAPE0VYc3yOzChk5fYk65qDf3LybxtlXkyp23PXDTnDNbvVPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813878; 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=LTVcxs3zmZZPcq4t5Fo6eg7JspEqf85wc4p/gO4AeV8=; b=IV7NXJL99c3EjimphIYmXFrf+QkA6E+IwifDM1CY5GGcFNSLPmRRk/9UCj3mjr1lAo9jBvzLwN7VIHyMjBoTx+0dLh9P0K4QLYjcDIkLsm2o5xUNA46W4Ltj4xZnTfVtgWxtqa54QmBQCCaFXpRvq1lR90KiMwf+KFw67gm4x2Q= 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 160081387850221.1027262263367; Tue, 22 Sep 2020 15:31:18 -0700 (PDT) Received: from localhost ([::1]:49992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqoe-0006Hh-Vb for importer@patchew.org; Tue, 22 Sep 2020 18:31:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjc-0008Jf-21 for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqja-0006L2-DK for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:03 -0400 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-580-QrzPa4irMAuEklbji8MOuw-1; Tue, 22 Sep 2020 18:25:59 -0400 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 05D021005E64; Tue, 22 Sep 2020 22:25:58 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id C777273670; Tue, 22 Sep 2020 22:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813561; 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=LTVcxs3zmZZPcq4t5Fo6eg7JspEqf85wc4p/gO4AeV8=; b=Bx/b/3tWJYeF0L3BTw/W4EBM2HtjjNvf+AbkMCooPMtHnuhWFXLzPznAhVpc1nqKlBmPxC C6Fi8cm2gvtajetSdUhM20ObWqXkuCddmDpZ0D04LKaUh6zsySwxCfx2gaVVKUJgOJhhcx Pl0+wUMMdPzvjAOzQ5nyMpNrwqQNK28= X-MC-Unique: QrzPa4irMAuEklbji8MOuw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 06/11] cpu/core: Register core-id and nr-threads as class properties Date: Tue, 22 Sep 2020 18:25:37 -0400 Message-Id: <20200922222542.2354748-7-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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/09/22 02:07:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Igor Mammedov 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: Igor Mammedov Message-Id: <20200921221045.699690-18-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/cpu/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 3a659291eae..92d3b2fbad6 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -69,10 +69,6 @@ static void cpu_core_instance_init(Object *obj) MachineState *ms =3D MACHINE(qdev_get_machine()); CPUCore *core =3D CPU_CORE(obj); =20 - object_property_add(obj, "core-id", "int", core_prop_get_core_id, - core_prop_set_core_id, NULL, NULL); - object_property_add(obj, "nr-threads", "int", core_prop_get_nr_threads, - core_prop_set_nr_threads, NULL, NULL); core->nr_threads =3D ms->smp.threads; } =20 @@ -81,6 +77,10 @@ static void cpu_core_class_init(ObjectClass *oc, void *d= ata) DeviceClass *dc =3D DEVICE_CLASS(oc); =20 set_bit(DEVICE_CATEGORY_CPU, dc->categories); + object_class_property_add(oc, "core-id", "int", core_prop_get_core_id, + core_prop_set_core_id, NULL, NULL); + object_class_property_add(oc, "nr-threads", "int", core_prop_get_nr_th= reads, + core_prop_set_nr_threads, NULL, NULL); } =20 static const TypeInfo cpu_core_type_info =3D { --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813982; cv=none; d=zohomail.com; s=zohoarc; b=J+XdFpinIYdKMvuZohsVRINUKfROSF7nNWCMkxor0mgCHyB8rrCHmDzIsEzTwauEPJim+koe0kHf9pgvJTb2zGvJFZfPq2E7OGJvJQtI7IDnItLGx3dj7pY5kJwk7r5okL7JK7/lO+qw6IqsahxsnWUql196qHa8jEibJGTQSQU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813982; 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=Mj1eNu8+Bq+H/pkqBzu9vKC/BDj3dYWth+xbsJlzm4M=; b=SJR8ZKc1KfP7rMjyaPrHHJn+jGAjmri3X31vcy/vkgf8302LLdJER3PGFzJ8tkp888oVfeD+Ki69pWLIoCsYTmzPBAOkKP7l6WWw7UI0UDI136RAZEnnzNoYhTnOssVAsdExxOH5vuKUrNMRQrQLoKPp1/5TONW6OHc3Reiqtto= 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 160081398201025.008733148194324; Tue, 22 Sep 2020 15:33:02 -0700 (PDT) Received: from localhost ([::1]:54844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqqK-0008MB-O6 for importer@patchew.org; Tue, 22 Sep 2020 18:33:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqje-0008Nt-0A for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjc-0006LD-8P for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:05 -0400 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-53-yPChLJ5IM7iLRzdJmthCfg-1; Tue, 22 Sep 2020 18:26:01 -0400 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 128251084D70; Tue, 22 Sep 2020 22:25:59 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD29C2C31E; Tue, 22 Sep 2020 22:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813563; 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=Mj1eNu8+Bq+H/pkqBzu9vKC/BDj3dYWth+xbsJlzm4M=; b=SDUnrdoESn37WCE5xfy2SMhs6d8uqjP+z4GnHMV/IVTfEIZ4txUzamTgN4HkiLq/G2MNq6 bfkLOjsgTopJQjzzU9zM+KbUbCjJH7suop8y7ccLwhxXJ1V9ryxULFJf7AfqYSbeaCNMy4 kFyKCOQEguEzttcpBKG7N/e65aDMq50= X-MC-Unique: yPChLJ5IM7iLRzdJmthCfg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 07/11] xlnx-zcu102: Register properties as class properties Date: Tue, 22 Sep 2020 18:25:38 -0400 Message-Id: <20200922222542.2354748-8-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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/09/22 15:47:47 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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: Paolo Bonzini , Alistair Francis , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= 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: Alistair Francis Message-Id: <20200921221045.699690-20-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/arm/xlnx-zcu102.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index 066571a9723..ad7fff9697b 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -206,20 +206,8 @@ static void xlnx_zcu102_machine_instance_init(Object *= obj) =20 /* Default to secure mode being disabled */ s->secure =3D false; - object_property_add_bool(obj, "secure", zcu102_get_secure, - zcu102_set_secure); - object_property_set_description(obj, "secure", - "Set on/off to enable/disable the ARM " - "Security Extensions (TrustZone)"); - /* Default to virt (EL2) being disabled */ s->virt =3D false; - object_property_add_bool(obj, "virtualization", zcu102_get_virt, - zcu102_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 static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data) @@ -235,6 +223,19 @@ static void xlnx_zcu102_machine_class_init(ObjectClass= *oc, void *data) mc->max_cpus =3D XLNX_ZYNQMP_NUM_APU_CPUS + XLNX_ZYNQMP_NUM_RPU_CPUS; mc->default_cpus =3D XLNX_ZYNQMP_NUM_APU_CPUS; mc->default_ram_id =3D "ddr-ram"; + + object_class_property_add_bool(oc, "secure", zcu102_get_secure, + zcu102_set_secure); + object_class_property_set_description(oc, "secure", + "Set on/off to enable/disable th= e ARM " + "Security Extensions (TrustZone)= "); + + object_class_property_add_bool(oc, "virtualization", zcu102_get_virt, + zcu102_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"); } =20 static const TypeInfo xlnx_zcu102_machine_init_typeinfo =3D { --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813813; cv=none; d=zohomail.com; s=zohoarc; b=bXXwKxAQ8MGdJWHJIJ5YPHATN1e5gUqZtkpKvcvy8BVWhDaCQLP5AiOHT7+gAiCmFOznRBMVI+vJ42ddo/nU4yQQp1hzyx9JVYfgMbfT3o2iGQ2i3uIvG+SKRDgpL4TITRraEGDO0UcscYeuj51eXkvol9wi6QKjkHxRE/j+C70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813813; 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=QnyVU/vi6GJ+a+6szWz2En33hmnBmflgThBMoF42wK0=; b=jjLhsyNPRcAAimM+yhDfgfOMd82IpD0O1YFbjBCTm3+TmyRoMeLpBmrCddbR0RRF5bWJSOS3k2xAINJ1z5fMeHcBS2FRhhkPQfgrpfyDP2rgmdbmnG2Kx/hwN+0iEGwCpOA3JI+Sybo1tiPtqaF6Z3bMhQe4JSNtZ2k1shht/wY= 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 1600813813723829.9725841429481; Tue, 22 Sep 2020 15:30:13 -0700 (PDT) Received: from localhost ([::1]:47170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqnc-00053l-Cn for importer@patchew.org; Tue, 22 Sep 2020 18:30:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjd-0008Nc-U4 for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjc-0006LB-80 for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:05 -0400 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-131-fRugZDabPR2hpXT-_emX7g-1; Tue, 22 Sep 2020 18:26:01 -0400 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 276FB801FDD; Tue, 22 Sep 2020 22:26:00 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCE9A55765; Tue, 22 Sep 2020 22:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813563; 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=QnyVU/vi6GJ+a+6szWz2En33hmnBmflgThBMoF42wK0=; b=GGB/Y9UWdDmmm2P84HIEjQgTaOSbFlRnhnUOnJJI5GZWy0p2beVXmpL65fVGvwLhx3asCu iRLiWCnRv0izge48GBZafSTz0Ho7RvgtFlY41wfgFsAwzoAIzKVbt+pc2fRBs0htmEf4OH 3uoHSCndtefjmyrx4uEYIhzS0XOkqn0= X-MC-Unique: fRugZDabPR2hpXT-_emX7g-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 08/11] machine: Register "memory-backend" as class property Date: Tue, 22 Sep 2020 18:25:39 -0400 Message-Id: <20200922222542.2354748-9-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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/09/22 15:47:47 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Igor Mammedov 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: Igor Mammedov Message-Id: <20200921221045.699690-21-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/machine.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 09aee4ea52b..9b02fb2f5ed 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -866,6 +866,12 @@ static void machine_class_init(ObjectClass *oc, void *= data) machine_get_memory_encryption, machine_set_memory_encryption); object_class_property_set_description(oc, "memory-encryption", "Set memory encryption object to use"); + + object_class_property_add_str(oc, "memory-backend", + machine_get_memdev, machine_set_memdev); + object_class_property_set_description(oc, "memory-backend", + "Set RAM backend" + "Valid value is ID of hostmem ba= sed backend"); } =20 static void machine_class_base_init(ObjectClass *oc, void *data) @@ -917,12 +923,6 @@ static void machine_initfn(Object *obj) "Table (HMAT)"); } =20 - object_property_add_str(obj, "memory-backend", - machine_get_memdev, machine_set_memdev); - object_property_set_description(obj, "memory-backend", - "Set RAM backend" - "Valid value is ID of hostmem based ba= ckend"); - /* Register notifier when init is done for sysbus sanity checks */ ms->sysbus_notifier.notify =3D machine_init_notify; qemu_add_machine_init_done_notifier(&ms->sysbus_notifier); --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600814064; cv=none; d=zohomail.com; s=zohoarc; b=mnwmXVRhnDiJ1SHspw64ke5Ug+bh+SpbpD7mYTMID26LDcNAF/3QWtYuY73aBTl/TrwkCBq4lUk4ZkEWcQoO6I7smPSa+SSpa2Q2OdwR2QGLY7Cf++y7RVYvkzLT6pqSYvTHE4M77+ljnu0MZM1dk8mHgf48MR+/YR0oNryrzK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600814064; 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=pD66mRra1s/USq9HMY95tB2B6J0Gqgyb9MdS85lj7Rw=; b=HQv5seYXVWLNiBhSQ2ah9M5WNThqRu+/v59p6W6wLB7jVJWzhpT5vzQsuGvtAwuz4Rj8Xd37CvTK3RC6ob5F1nXtE0KyHRmkL9jk0WpTxhbn1tZi/F7bHG2vEWqwtF+p8oDtsKdI8MdHGQKiEMs4XZY1u6F4x6Wa+vhEpD5Mk/Y= 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 1600814064056862.4437293708668; Tue, 22 Sep 2020 15:34:24 -0700 (PDT) Received: from localhost ([::1]:32846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqre-0002TR-NU for importer@patchew.org; Tue, 22 Sep 2020 18:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjf-0008RR-Cz for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjd-0006LM-Ik for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:07 -0400 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-ldHHHItCO_KrZWRjDjzxRg-1; Tue, 22 Sep 2020 18:26:02 -0400 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 36E15802B5E; Tue, 22 Sep 2020 22:26:01 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB38673670; Tue, 22 Sep 2020 22:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813564; 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=pD66mRra1s/USq9HMY95tB2B6J0Gqgyb9MdS85lj7Rw=; b=i0IualcQ+vZIXadKVpKDqzjSHTpngTLnjfYxsWhaI0RhUP/dGYs8owBILLKc6Qu0zb+AKP wPff0eMbYIotV6HwwIR1uq069hQGSU2V21jp1gyYIuA8RnIZZcM9dXprkx0X6V+Py92zqR vFn7HQcPgeG2T/CFqI+W3uQk1YhChz8= X-MC-Unique: ldHHHItCO_KrZWRjDjzxRg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 09/11] i440fx: Register i440FX-pcihost properties as class properties Date: Tue, 22 Sep 2020 18:25:40 -0400 Message-Id: <20200922222542.2354748-10-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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/09/22 15:47:47 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Igor Mammedov 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: Igor Mammedov Message-Id: <20200921221045.699690-23-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/pci-host/i440fx.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index aecbcc2446e..28c9bae8994 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -210,22 +210,6 @@ static void i440fx_pcihost_initfn(Object *obj) "pci-conf-idx", 4); memory_region_init_io(&s->data_mem, obj, &pci_host_data_le_ops, s, "pci-conf-data", 4); - - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", - i440fx_pcihost_get_pci_hole_start, - NULL, NULL, NULL); - - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", - i440fx_pcihost_get_pci_hole_end, - NULL, NULL, NULL); - - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", - i440fx_pcihost_get_pci_hole64_start, - NULL, NULL, NULL); - - object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", - i440fx_pcihost_get_pci_hole64_end, - NULL, NULL, NULL); } =20 static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) @@ -401,6 +385,22 @@ static void i440fx_pcihost_class_init(ObjectClass *kla= ss, void *data) device_class_set_props(dc, i440fx_props); /* Reason: needs to be wired up by pc_init1 */ dc->user_creatable =3D false; + + object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32= ", + i440fx_pcihost_get_pci_hole_start, + NULL, NULL, NULL); + + object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32", + i440fx_pcihost_get_pci_hole_end, + NULL, NULL, NULL); + + object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint= 64", + i440fx_pcihost_get_pci_hole64_start, + NULL, NULL, NULL); + + object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64= ", + i440fx_pcihost_get_pci_hole64_end, + NULL, NULL, NULL); } =20 static const TypeInfo i440fx_pcihost_info =3D { --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813988; cv=none; d=zohomail.com; s=zohoarc; b=glR4Aaa1VkM2w85ILftEqxNfCEo6zfskjrGJF9NSEy1wkazlmFBG9N3MYZ9IJCiAMi/NCZcNYKlilplLdbhCvFyj8m9usQVUSJdSjVhkUEar3Lu3tGtA7vO1hUxD42yz0lc8fRCkcqOhg4XMTO/zKdgLReRy2sFnXUADi/UR7Ew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813988; 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=I6I56F4bd+wSlySGXI18nj464OmVK4ktLNK4FdKgXXg=; b=OAsdeE4v6Ut4z/1D1AM92UajySkMKjqCT6aIE2yBonOO4Vneyn1YH3wjzD7weiFPfmieW0aeyyAu32Lhu6jdsHBaUTHBEqsd9C5pQVwcPBipnNMha8Xg1bIjKVGfeG5qTjDQ1DVnwRTB5/FZijpc8p9qxBJCyfITSYBslRwqkSs= 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 1600813988262846.8707434142229; Tue, 22 Sep 2020 15:33:08 -0700 (PDT) Received: from localhost ([::1]:55412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqqQ-00008F-W9 for importer@patchew.org; Tue, 22 Sep 2020 18:33:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjg-0008VE-Jt for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:42329 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqje-0006Lc-Sy for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:08 -0400 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-188-J-lQBUFBPWCOjmtXMQMaWw-1; Tue, 22 Sep 2020 18:26:04 -0400 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 E9BEF1868429; Tue, 22 Sep 2020 22:26:02 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 819A473670; Tue, 22 Sep 2020 22:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813566; 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=I6I56F4bd+wSlySGXI18nj464OmVK4ktLNK4FdKgXXg=; b=RjzH6H2OdU8KST9ra0K1ueyRDhxo//nakgkFiRdDQH2gSS7T1iJ/VMXHc38mqiEeG3Gg9V wz0YLBl2kjl145TAbD6IoanRZyqFBu7mIV8fO+isb1XQo8bEy7WJq/4OCnU2uOCIWoNNzu LCUhXnX53gcjscxaXzrs4Y53BCotc7A= X-MC-Unique: J-lQBUFBPWCOjmtXMQMaWw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 10/11] sifive_e: Register "revb" as class property Date: Tue, 22 Sep 2020 18:25:41 -0400 Message-Id: <20200922222542.2354748-11-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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=205.139.110.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 13:33:09 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Alistair Francis , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= 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: Alistair Francis Message-Id: <20200921221045.699690-24-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/riscv/sifive_e.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c index 759059cd7bf..fcfac168161 100644 --- a/hw/riscv/sifive_e.c +++ b/hw/riscv/sifive_e.c @@ -137,11 +137,6 @@ static void sifive_e_machine_instance_init(Object *obj) SiFiveEState *s =3D RISCV_E_MACHINE(obj); =20 s->revb =3D false; - object_property_add_bool(obj, "revb", sifive_e_machine_get_revb, - sifive_e_machine_set_revb); - object_property_set_description(obj, "revb", - "Set on to tell QEMU that it should mo= del " - "the revB HiFive1 board"); } =20 static void sifive_e_machine_class_init(ObjectClass *oc, void *data) @@ -152,6 +147,12 @@ static void sifive_e_machine_class_init(ObjectClass *o= c, void *data) mc->init =3D sifive_e_machine_init; mc->max_cpus =3D 1; mc->default_cpu_type =3D SIFIVE_E_CPU; + + object_class_property_add_bool(oc, "revb", sifive_e_machine_get_revb, + sifive_e_machine_set_revb); + object_class_property_set_description(oc, "revb", + "Set on to tell QEMU that it sho= uld model " + "the revB HiFive1 board"); } =20 static const TypeInfo sifive_e_machine_typeinfo =3D { --=20 2.26.2 From nobody Mon Apr 29 09:25:52 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=1600813980; cv=none; d=zohomail.com; s=zohoarc; b=VP4H59xPxafbUroFqbXDVZkKBiVoAv9SI3Tvv763qnHjKr5mWrke/IQFgxo799oW6QWyWeXC97RiLTSq9GYyGLwcWb4ZTytRDg+NYBUrJRNWMU9WxVstR1Xi9XP1EqZWW85oF3x/V3Nk3vX4HzdjAHEaObZWkaGJewfHyKUbB4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600813980; 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=fh7e7Rjmi72oO8UNU1nk0X5y6rGjwRA2sLHT6riiTZs=; b=cHE+wStRZ9JLLw88W0Dx5oxOPEYG4HhIwj21vO7jEMtw8hy0//VMhEln2WO7I9xPIn5wK9FknRa/B/KhjoJkmouNhlxjJ1N04GB4zIiC7QlfNoRbsXnTZmbGW+vt+dkjJOQjk+58hiXfKcwineP3O68GjE7zOgHj4R5WXkO3VPo= 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 1600813980907308.3504255590351; Tue, 22 Sep 2020 15:33:00 -0700 (PDT) Received: from localhost ([::1]:54738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqqJ-0008JS-KX for importer@patchew.org; Tue, 22 Sep 2020 18:32:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKqjo-0000Dq-9I for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:16 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:53845 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kKqjh-0006Lq-MW for qemu-devel@nongnu.org; Tue, 22 Sep 2020 18:26:15 -0400 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-572-ZyrXXXnVN2SbGkR_x0nugA-1; Tue, 22 Sep 2020 18:26:05 -0400 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 C321D801FDD; Tue, 22 Sep 2020 22:26:04 +0000 (UTC) Received: from localhost (unknown [10.10.67.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E6525DD99; Tue, 22 Sep 2020 22:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600813568; 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=fh7e7Rjmi72oO8UNU1nk0X5y6rGjwRA2sLHT6riiTZs=; b=aTNklds96ZfDxROTs5hOU/4CQlKzQpwVon8Za2RKuAQp7jCOtBSUI+GdKvBb8sxcPWhKwj uV2fr8foJ60eIRtxv2RIq3k+YgDW7hPdoM7G9xQFXfH/XZFW8knHGF/9dfPM1ymdu2SX21 8j9EuAvTZDF+Wwit7FvWsXqp4U0Ckko= X-MC-Unique: ZyrXXXnVN2SbGkR_x0nugA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 11/11] sifive_u: Register "start-in-flash" as class property Date: Tue, 22 Sep 2020 18:25:42 -0400 Message-Id: <20200922222542.2354748-12-ehabkost@redhat.com> In-Reply-To: <20200922222542.2354748-1-ehabkost@redhat.com> References: <20200922222542.2354748-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=205.139.110.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 13:33:09 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.455, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Alistair Francis , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= 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: Alistair Francis Message-Id: <20200921221045.699690-25-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/riscv/sifive_u.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index a97637fb333..6ad975d6923 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -568,14 +568,6 @@ static void sifive_u_machine_instance_init(Object *obj) SiFiveUState *s =3D RISCV_U_MACHINE(obj); =20 s->start_in_flash =3D false; - object_property_add_bool(obj, "start-in-flash", - sifive_u_machine_get_start_in_flash, - sifive_u_machine_set_start_in_flash); - object_property_set_description(obj, "start-in-flash", - "Set on to tell QEMU's ROM to jump to " - "flash. Otherwise QEMU will jump to DR= AM " - "or L2LIM depending on the msel value"= ); - s->msel =3D 0; object_property_add(obj, "msel", "uint32", sifive_u_machine_get_uint32_prop, @@ -599,6 +591,14 @@ static void sifive_u_machine_class_init(ObjectClass *o= c, void *data) mc->max_cpus =3D SIFIVE_U_MANAGEMENT_CPU_COUNT + SIFIVE_U_COMPUTE_CPU_= COUNT; mc->min_cpus =3D SIFIVE_U_MANAGEMENT_CPU_COUNT + 1; mc->default_cpus =3D mc->min_cpus; + + object_class_property_add_bool(oc, "start-in-flash", + sifive_u_machine_get_start_in_flash, + sifive_u_machine_set_start_in_flash); + object_class_property_set_description(oc, "start-in-flash", + "Set on to tell QEMU's ROM to ju= mp to " + "flash. Otherwise QEMU will jump= to DRAM " + "or L2LIM depending on the msel = value"); } =20 static const TypeInfo sifive_u_machine_typeinfo =3D { --=20 2.26.2