From nobody Fri Dec 19 20:22:00 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=1733748714; cv=none; d=zohomail.com; s=zohoarc; b=dhz/AeLjJILc63Qvdzm8+V/1ZcKd1n9gLdTu1jGoQUcEV+Rz5BDwZULzaFZJd58AoUwSuFx/HGHFuE1lDHZD6r490IjDvu2EvNi40NQP66FRGOc4csL44ECHBeFwXWfc6ph7LppJ9esIl8YGWN+ErJk9lhFjNXgI5Oaa6JZo570= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733748714; 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=d/CuNDAf/h1lPd4tHb600O5eISjRNvbweuEs0GGCzf8=; b=FXYdeUjPDjFXYK6IrD8UPb5wp79I+i691NEWRwDZJkg77xQSA5TmEK3MEKKHnPxmJ/hD9LowtZozgOJUUdIwOUKbZ+6DxA9lzgDyUkl90cplOOIgn2GLZzGVqssyu3gPzKOe9NfmhPMCGSo+8XxsxoXO14Immko1zIYz+W+xgh4= 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 1733748714247448.6489880848909; Mon, 9 Dec 2024 04:51:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKd1O-0003ul-4R; Mon, 09 Dec 2024 07:37:54 -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 1tKd1M-0003s0-Kj for qemu-devel@nongnu.org; Mon, 09 Dec 2024 07:37:52 -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 1tKd1E-0007Q8-PQ for qemu-devel@nongnu.org; Mon, 09 Dec 2024 07:37:50 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-447-LppsLzdCPvewx-pvpsPnqQ-1; Mon, 09 Dec 2024 07:37:39 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-434e8beee61so9513785e9.0 for ; Mon, 09 Dec 2024 04:37:39 -0800 (PST) Received: from [192.168.10.47] ([151.81.118.45]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0be4sm191423765e9.28.2024.12.09.04.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 04:37:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733747860; 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=d/CuNDAf/h1lPd4tHb600O5eISjRNvbweuEs0GGCzf8=; b=JXpmucRdOBFy6WweyI04LSvQW/FoWA283cYKpzp90t7sKRtrFoiww2fXZaGZNDrxDefpp7 f/6l82jlX68mbJpK+Id9zFnhwPkRJc3ydKOofdeYiepFs7QIaSLJ6cUJgOjbIvBAnXWDK6 c5moH9PJPnykApOzOqlz9vYZmKrh/Ls= X-MC-Unique: LppsLzdCPvewx-pvpsPnqQ-1 X-Mimecast-MFC-AGG-ID: LppsLzdCPvewx-pvpsPnqQ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733747858; x=1734352658; 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=d/CuNDAf/h1lPd4tHb600O5eISjRNvbweuEs0GGCzf8=; b=NVlMQlW6L1xPuMf9eYjEgTmTp8HKMhIKOFcyLBU8+NhO7alWQuxgPK9pKib5EQj+gd F+DI5VbTlUNcV8cf8c7ALF6ooE6G4HQMP82HpsYX9JmS1zz8Rc//D7KZ9ksWBdleXhcw CqyeyZ3jJrU688XUB70JD/ew34PnL4c1zwM9RTpONVIOzUJ7ZwpbqP68K6Onb+fH3+IQ whXDtMrdTUH8NNh2mMx1E0ToWzOSUctcClzDIpPcQGDTP7+D3Qi0Abrb0wKGiCz8/ZJp Qf58pYuakW8dL7RoBMeRZhkR5/TBvw+Z7AK444maF+1aPLPSLrZmLME9e7ihTxeENY2k +H4A== X-Gm-Message-State: AOJu0YygkeMPeAXt9Mvf9TC9rEUfrubTENMyp7dtezBbvAVpkeYDdNEq K2cBBMuBNp6L2ZrDvUZ2jAk4f73f7BiOJIqisjucjqxTwi036dE9OeqSrtsF2BrwqKHmx0tytpT npkbs4hjIvFXI7+uF8LVIRsv7E/YeyL3W/larWHA2ZXqjGPWalSen5F6OrxHIFeZLBCbFJ7klFS x71qEY3u8PWTJifeMsQ1DhODXI/lIWag43JKF9 X-Gm-Gg: ASbGncurqKHg7d5VD8zrOANZxDI1hD1dfdfWDQSe9lSQEE5FgBmnvxPXRx2ljHUINsi BapLz7ETZVzh1YHIh1fHc8xC5YYIIVBdEqwGoBGk4ZH/9ADBQff5NrHwdxb9K/0LGT2XkvyhT6J CTpg9I7CXqikZMJhuIaBj8nniAvsj/vDbeFSymlh+ask5rFJlnkspYdyCniA2A3XrQFhHih4/Uc D3q0mIW0nW8C36vvDMqq1+zxR7YWl93iRIXLxEGJo9nWmnSddlPoQ== X-Received: by 2002:a05:600c:3b1e:b0:434:9d3c:31ec with SMTP id 5b1f17b1804b1-434d92bf66amr121068015e9.10.1733747857763; Mon, 09 Dec 2024 04:37:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKosmxVjsdlGtzG1n53ELAg0Tz6RFW8udLUmBqIrFlJPlfcQ6F4Dy5UXlW6uhM4cO07tODkg== X-Received: by 2002:a05:600c:3b1e:b0:434:9d3c:31ec with SMTP id 5b1f17b1804b1-434d92bf66amr121067765e9.10.1733747857319; Mon, 09 Dec 2024 04:37:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-rust@nongnu.org, Zhao Liu , Junjie Mao Subject: [PATCH 07/26] rust: qom: add default definitions for ObjectImpl Date: Mon, 9 Dec 2024 13:36:58 +0100 Message-ID: <20241209123717.99077-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241209123717.99077-1-pbonzini@redhat.com> References: <20241209123717.99077-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.489, 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.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: 1733748823969116600 Content-Type: text/plain; charset="utf-8" Remove a bunch of duplicate const definitions. Signed-off-by: Paolo Bonzini Reviewed-by: Zhao Liu --- 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 c5c8c463d37..3d173ae816d 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.1