From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7ABBECD98C8 for ; Tue, 9 Jun 2026 17:26:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wX0Cl-0007W5-CX; Tue, 09 Jun 2026 13:25:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wX0Cb-0007KU-MA for qemu-rust@nongnu.org; Tue, 09 Jun 2026 13:25:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wX0CY-0001os-Ua for qemu-rust@nongnu.org; Tue, 09 Jun 2026 13:25:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781025922; 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=aVVARmJUwhep7oD37d2RCWN4JLy97YXNlME0a8arUGM=; b=Z01QdNG+wea6xfS2B3ZgWSRjIIym0Vfb89BPTFaf+zJ3K6DmQjhKcc4kRK76M2JcomK9oK 0IdL0hm16JtTobpBJc6NE/5IodR4tkts3vDw6niQlzv2sDWbyWVTxM/578xQtF7P6CboTm dM9yu1KJZ8BTGWIOokoNrR9BY5/nx4U= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-676-7zJM941UNx2MKkRFV6_EEw-1; Tue, 09 Jun 2026 13:25:21 -0400 X-MC-Unique: 7zJM941UNx2MKkRFV6_EEw-1 X-Mimecast-MFC-AGG-ID: 7zJM941UNx2MKkRFV6_EEw_1781025920 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-5178fc89b2aso95897481cf.3 for ; Tue, 09 Jun 2026 10:25:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781025920; x=1781630720; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aVVARmJUwhep7oD37d2RCWN4JLy97YXNlME0a8arUGM=; b=bDPsTDSiSXQTpmgVvgtzy8YhNjthOXzSwIDg/8BDmYtgo35MMjQRAqHMjmNmASzEJ/ LKc+Yc9PSaOIbXDFKV6frhkBpWCLph6afq4gOiGgmLLfnF0Q864zgHTTyX/qX2+418Hf ytNM+OoBdQB/tyw09/jkRDL5F6+mm8gBddVEYQERWQoHEozdvHMKOPIi6Tsy2obshCDf AeV5h04e731xAg8uAr+KIyYv2ZTsxOWZaOuPnjJ6DNgl2OpVq9Wefu0okG5/tTfm+BR+ RGb3RXqvz6Ur8XziVPkArRXbdeYP2rEwd/zrxymS2ZZRDDgdLbAy+l4O3OaVXlkiBkJD se9g== X-Forwarded-Encrypted: i=1; AFNElJ/iN8Qu42cLM1PGOTv5n0znChHhGnWzZY4/eoA/CPW6fRqmBrqJZhswf2J2+/GAzGWDC+/JAgwVitg=@nongnu.org X-Gm-Message-State: AOJu0YzOiUcaM+bQ6nTP5INjQggu1zum3SuJEhyk1O882A6xJUkLTaBj uJO1PYA1LQlM7xUUYnTzsgtl6vWRysD3wl+pbXuimqI0bjEZMLoj+pNe5+pI/DhOwr4qyT1we5c HGOsQ3YYRY36txfoAMe1h8cXtHN/hribrT1/VkHoW7S+MlNBfvo/t4Xc= X-Gm-Gg: Acq92OGOsCjWO7jYY6RdnwTyLPRXOBcQqJ8ecNGSNNlrM1ui4XaNyR8fRMloMgj4zvO a1Jp71LrKInHKpUFdTuW/ypDLNUvP+hr1HhMQJPmbXr9b/2vEXQRSob9QZqEkwqut70n/aZsbLX eew3TFe+lBaTtpWmumO6P/vA64Ri5zEE0aLtV3J5m8Xj/WFmLMY3o3whlgrcdrMfLb3SMCZ/0DF uEwGkU1R5Jht/H/ZWjOVsO3HxT1DxfEHFuGP7ckAHiXn3q/GfP+F3MgdIZ85ZmR5gfK3hUF1HD/ NEetx0JTIhiMeykgiF9CV2700koV4SvYxhEVNT45x28/Puoqm2wh9fcZHOhxzMlm5ODObMaYcgD a0FTas4zYP32Rq5gHdAIe3q4= X-Received: by 2002:a05:622a:47cf:b0:517:2c1e:8b6 with SMTP id d75a77b69052e-51795c66183mr278467261cf.38.1781025920315; Tue, 09 Jun 2026 10:25:20 -0700 (PDT) X-Received: by 2002:a05:622a:47cf:b0:517:2c1e:8b6 with SMTP id d75a77b69052e-51795c66183mr278466621cf.38.1781025919664; Tue, 09 Jun 2026 10:25:19 -0700 (PDT) Received: from x1.com ([142.189.10.167]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51775da2c56sm187524711cf.21.2026.06.09.10.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 10:25:19 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Fabiano Rosas , Vladimir Sementsov-Ogievskiy , Peter Maydell , "Dr . David Alan Gilbert" , Eric Blake , Akihiko Odaki , Peter Xu , Paolo Bonzini , Kevin Wolf , Sana Sharma , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Juraj Marcin , qemu-rust@nongnu.org, Markus Armbruster , Mark Cave-Ayland Subject: [PATCH v2 01/10] migration: Use OBJECT_DECLARE_SIMPLE_TYPE Date: Tue, 9 Jun 2026 13:25:05 -0400 Message-ID: <20260609172514.2037645-2-peterx@redhat.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260609172514.2037645-1-peterx@redhat.com> References: <20260609172514.2037645-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Ms3Zq2gVKAok9hIFmUkcGX3n9VaJJxN6zVMTYL20lVU_1781025920 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, 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_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-rust@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: QEMU Rust-related patches and discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-rust-bounces+qemu-rust=archiver.kernel.org@nongnu.org Sender: qemu-rust-bounces+qemu-rust=archiver.kernel.org@nongnu.org Migration object's class has nothing special, switch to the newly introduced macro. Suggested-by: Daniel P. Berrangé Signed-off-by: Peter Xu --- migration/migration.h | 9 +-------- migration/migration.c | 7 +++---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/migration/migration.h b/migration/migration.h index 841f49b215..293ad60e07 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -263,14 +263,7 @@ void fill_destination_postcopy_migration_info(MigrationInfo *info); #define TYPE_MIGRATION "migration" -typedef struct MigrationClass MigrationClass; -DECLARE_OBJ_CHECKERS(MigrationState, MigrationClass, - MIGRATION_OBJ, TYPE_MIGRATION) - -struct MigrationClass { - /*< private >*/ - DeviceClass parent_class; -}; +OBJECT_DECLARE_SIMPLE_TYPE(MigrationState, MIGRATION); struct MigrationState { /*< private >*/ diff --git a/migration/migration.c b/migration/migration.c index 074d3f2c69..278cad502a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -297,7 +297,7 @@ void migration_object_init(void) { /* This can only be called once. */ assert(!current_migration); - current_migration = MIGRATION_OBJ(object_new(TYPE_MIGRATION)); + current_migration = MIGRATION(object_new(TYPE_MIGRATION)); /* * Init the migrate incoming object as well no matter whether @@ -3975,7 +3975,7 @@ static void migration_class_init(ObjectClass *klass, const void *data) static void migration_instance_finalize(Object *obj) { - MigrationState *ms = MIGRATION_OBJ(obj); + MigrationState *ms = MIGRATION(obj); qapi_free_BitmapMigrationNodeAliasList(ms->parameters.block_bitmap_mapping); qapi_free_strList(ms->parameters.cpr_exec_command); @@ -3993,7 +3993,7 @@ static void migration_instance_finalize(Object *obj) static void migration_instance_init(Object *obj) { - MigrationState *ms = MIGRATION_OBJ(obj); + MigrationState *ms = MIGRATION(obj); ms->state = MIGRATION_STATUS_NONE; ms->mbps = -1; @@ -4040,7 +4040,6 @@ static const TypeInfo migration_type = { */ .parent = TYPE_DEVICE, .class_init = migration_class_init, - .class_size = sizeof(MigrationClass), .instance_size = sizeof(MigrationState), .instance_init = migration_instance_init, .instance_finalize = migration_instance_finalize, -- 2.53.0