From nobody Mon Nov 17 10:26:53 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1732521973; cv=none; d=zohomail.com; s=zohoarc; b=jXuU+ItJdkN7tPsw3515lfMPGBYiY5UMAULA0kfKsJwgLMX4FTYGAPdh8FclZ8LmiOJF3zXEh5zkJanNE5LJJcekgBU9Bl6P2tz7v1wKmFXp4nePo6sC1wtP+eQs67d8yFrhtp+ETidGWiqbTOISbKGH8a2FatovK0R0vh6miTI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732521973; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9YzRwPCPqfMJAUUv5E85p/jUSPh5N41oWjEesEjecPY=; b=bhpWYvMOk8dwLgQB2oY3eY7LKk5UC4t1acFNPvu/A6CbXMsP1pUsrju8qFhq2WtOJuwOPWfxTvrWZC0IiiO79oHOI5z3U+x86vQzvunc5d3584G3tV7M4GDnpGmCNj5f4V6k0scmOqhnL8BR8J0wgmYOt1asUGdsQbmJKADPV94= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732521973626850.3925307890663; Mon, 25 Nov 2024 00:06:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFU69-0004pM-Li; Mon, 25 Nov 2024 03:05:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFU5x-0004mo-6v for qemu-devel@nongnu.org; Mon, 25 Nov 2024 03:05:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFU5v-0007HA-FZ for qemu-devel@nongnu.org; Mon, 25 Nov 2024 03:05:20 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-7-0tujKWceNdO8Cu5PvKr3Jw-1; Mon, 25 Nov 2024 03:05:14 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4349eeeb841so5411775e9.3 for ; Mon, 25 Nov 2024 00:05:14 -0800 (PST) Received: from [192.168.10.47] ([151.49.236.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434932dbc7esm68029535e9.37.2024.11.25.00.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 00:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732521917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9YzRwPCPqfMJAUUv5E85p/jUSPh5N41oWjEesEjecPY=; b=h21wbRZ6XiwiTFVjS6jqgHlJP/j62hl0zUPjeXO3qeaqq6fM/+hUO9AjdlpoPR4Qja9Gdx RH/6/rBhcNugeGwQIzyTvLX9d8LJmilBWAXmTigpDp0U/zOoxDK2INwuMLS+M+102guixJ 4EU/lDSMkEutilcUqSTJXbXjM8HtDBM= X-MC-Unique: 0tujKWceNdO8Cu5PvKr3Jw-1 X-Mimecast-MFC-AGG-ID: 0tujKWceNdO8Cu5PvKr3Jw X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732521913; x=1733126713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9YzRwPCPqfMJAUUv5E85p/jUSPh5N41oWjEesEjecPY=; b=vFy6l0/YhS07VAmIi8fMVN18srK6Hz+/Er4m7XQdYDevF9anFSzQ+h07HGV+0rukle 9oowtjoSOW2BrOPbgylodIMFnPW3jVT4IbWsxnJIXB9ce4zMAlmNibjEaKPi2T9uKV89 je7CS9vvEkly1bV709SFaeIi/9fOMWeLakG6ZKzrhDlNY9l8PuyeRR+Q9qG1UB/TU8G5 eBZKzg9zj3xUu9EhT9iB2381vLTjubcUM4eaezuvicOzfouWQ/Rf9dtYX6JkM6iadksB s56TRHahCuNfmfl/SqtKJh3msLube0LkwrRRuTEmWQT7U6gV4zmduxfq0oUuJC2C4sMr yhSA== X-Gm-Message-State: AOJu0Yz7HieAyLvfhBdzXzWv9LQPF/RFhimG9ENggL+mGFo2lZp6wzb6 /4/1xOHNbnQXfw15NLMuNm6Y9lwLpTOZDxvP+jNCeVV6rcJIQhx11rsY60uXskXXQAdPVDXhGpL 7SO4bciLB1168Ua6YQQLuBvpbSzlY5UgzqT7ez+SSlCC9XjLQTSId2xxXKUEZZvCzvvNNAtme39 XFtBO+CN0acqnrT6a1FeHKJh4++9r8QVo0unw8 X-Gm-Gg: ASbGncuSuhEh+sMUyZAPVRZzVjC4d4G6In32+GGTsDTCMpawc3Oizxcueq4KEWNNl29 4opfaemhEYfC7Vb5QtOwuWNYZpVdl7racV7lLiKP3n0x9Bu7tJV3tU+MZXKQRkNGPvwZECxjBDm nR3bLMALZaY8pAgxdiqMCPghf7r4knc3cZOz5dCc8G3hAVauKJTzLinEa2ZijeNDPZs+kY/CmDO HG2N4D85fzn9dsAb6YPf3mGhTJWPTBaHMfNvR7oyIiltDfSY6GFo/w= X-Received: by 2002:a05:600c:1e8c:b0:434:a10f:c3 with SMTP id 5b1f17b1804b1-434a10f016amr8175135e9.9.1732521912928; Mon, 25 Nov 2024 00:05:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdwNws0+xZD9wCQ46zmqUvjw5T12MCZnWPB0Xl++eDA+C4gGqWo1XQ71HT6mBe8ZblRHa2rQ== X-Received: by 2002:a05:600c:1e8c:b0:434:a10f:c3 with SMTP id 5b1f17b1804b1-434a10f016amr8174835e9.9.1732521912458; Mon, 25 Nov 2024 00:05:12 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-rust@nongnu.org Subject: [PATCH 1/8] rust: qom: add default definitions for ObjectImpl Date: Mon, 25 Nov 2024 09:05:00 +0100 Message-ID: <20241125080507.115450-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241125080507.115450-1-pbonzini@redhat.com> References: <20241125080507.115450-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.93, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1732521975266019100 Content-Type: text/plain; charset="utf-8" Remove a bunch of duplicate const definitions. Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 6 ------ rust/qemu-api/src/definitions.rs | 8 ++++---- rust/qemu-api/tests/tests.rs | 4 ---- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/devi= ce.rs index 7e57634bba0..f47e0f48d8a 100644 --- a/rust/hw/char/pl011/src/device.rs +++ b/rust/hw/char/pl011/src/device.rs @@ -109,10 +109,7 @@ impl ObjectImpl for PL011State { const TYPE_INFO: qemu_api::bindings::TypeInfo =3D qemu_api::type_info!= { Self }; const TYPE_NAME: &'static CStr =3D crate::TYPE_PL011; const PARENT_TYPE_NAME: Option<&'static CStr> =3D Some(TYPE_SYS_BUS_DE= VICE); - const ABSTRACT: bool =3D false; const INSTANCE_INIT: Option = =3D Some(pl011_init); - const INSTANCE_POST_INIT: Option =3D None; - const INSTANCE_FINALIZE: Option =3D None; } =20 #[repr(C)] @@ -666,8 +663,5 @@ impl ObjectImpl for PL011Luminary { const TYPE_INFO: qemu_api::bindings::TypeInfo =3D qemu_api::type_info!= { Self }; const TYPE_NAME: &'static CStr =3D crate::TYPE_PL011_LUMINARY; const PARENT_TYPE_NAME: Option<&'static CStr> =3D Some(crate::TYPE_PL0= 11); - const ABSTRACT: bool =3D false; const INSTANCE_INIT: Option = =3D Some(pl011_luminary_init); - const INSTANCE_POST_INIT: Option =3D None; - const INSTANCE_FINALIZE: Option =3D None; } diff --git a/rust/qemu-api/src/definitions.rs b/rust/qemu-api/src/definitio= ns.rs index 26597934bbd..92b3c6f9118 100644 --- a/rust/qemu-api/src/definitions.rs +++ b/rust/qemu-api/src/definitions.rs @@ -14,10 +14,10 @@ pub trait ObjectImpl { const TYPE_INFO: TypeInfo; const TYPE_NAME: &'static CStr; const PARENT_TYPE_NAME: Option<&'static CStr>; - const ABSTRACT: bool; - const INSTANCE_INIT: Option; - const INSTANCE_POST_INIT: Option; - const INSTANCE_FINALIZE: Option; + const ABSTRACT: bool =3D false; + const INSTANCE_INIT: Option = =3D None; + const INSTANCE_POST_INIT: Option =3D None; + const INSTANCE_FINALIZE: Option =3D None; } =20 pub trait Class { diff --git a/rust/qemu-api/tests/tests.rs b/rust/qemu-api/tests/tests.rs index 925f5a3c77b..f793ff26e5d 100644 --- a/rust/qemu-api/tests/tests.rs +++ b/rust/qemu-api/tests/tests.rs @@ -58,10 +58,6 @@ impl ObjectImpl for DummyState { const TYPE_INFO: qemu_api::bindings::TypeInfo =3D qemu_api::type_i= nfo! { Self }; const TYPE_NAME: &'static CStr =3D c_str!("dummy"); const PARENT_TYPE_NAME: Option<&'static CStr> =3D Some(device_clas= s::TYPE_DEVICE); - const ABSTRACT: bool =3D false; - const INSTANCE_INIT: Option =3D None; - const INSTANCE_POST_INIT: Option =3D None; - const INSTANCE_FINALIZE: Option =3D None; } =20 impl Class for DummyClass { --=20 2.47.0