QEMU-Arm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Peter Xu <peterx@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Cédric Le Goater" <clg@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Dr . David Alan Gilbert" <dave@treblig.org>,
	"Eric Blake" <eblake@redhat.com>,
	"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	"Peter Xu" <peterx@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Sana Sharma" <sansshar@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Juraj Marcin" <jmarcin@redhat.com>,
	qemu-rust@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Mark Cave-Ayland" <mark.caveayland@nutanix.com>
Subject: Re: [PATCH v2 01/10] migration: Use OBJECT_DECLARE_SIMPLE_TYPE
Date: Tue, 09 Jun 2026 19:55:31 -0300	[thread overview]
Message-ID: <87h5nb5noc.fsf@suse.de> (raw)
In-Reply-To: <20260609172514.2037645-2-peterx@redhat.com>

Peter Xu <peterx@redhat.com> writes:

> Migration object's class has nothing special, switch to the newly
> introduced macro.
>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  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,

Reviewed-by: Fabiano Rosas <farosas@suse.de>


  reply	other threads:[~2026-06-09 22:55 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 17:25 [PATCH v2 00/10] migration/qom: Remove TYPE_DEVICE dependency on migration object Peter Xu
2026-06-09 17:25 ` [PATCH v2 01/10] migration: Use OBJECT_DECLARE_SIMPLE_TYPE Peter Xu
2026-06-09 22:55   ` Fabiano Rosas [this message]
2026-06-10 13:56   ` Daniel P. Berrangé
2026-06-10 15:15   ` Mark Cave-Ayland
2026-06-09 17:25 ` [PATCH v2 02/10] qdev: Export global_props() Peter Xu
2026-06-09 22:55   ` Fabiano Rosas
2026-06-10 15:18   ` Mark Cave-Ayland
2026-06-09 17:25 ` [PATCH v2 03/10] qdev: Introduce DEFINE_PROP_*_NODEFAULT for bool/uint32 Peter Xu
2026-06-10 15:25   ` Mark Cave-Ayland
2026-06-09 17:25 ` [PATCH v2 04/10] hw/arm: Use nodefault version of qdev props when not needed Peter Xu
2026-06-10 15:31   ` Mark Cave-Ayland
2026-06-09 17:25 ` [PATCH v2 05/10] qom: Create object-property-ptr.[ch] Peter Xu
2026-06-10 16:15   ` Daniel P. Berrangé
2026-06-10 18:39     ` Peter Xu
2026-06-10 20:37       ` Fabiano Rosas
2026-06-11 13:52       ` Daniel P. Berrangé
2026-06-11 14:36         ` Fabiano Rosas
2026-06-11 14:40           ` Daniel P. Berrangé
2026-06-16 21:02             ` Peter Xu
2026-06-17 12:25               ` Fabiano Rosas
2026-06-17 12:27                 ` Daniel P. Berrangé
2026-06-11 12:54   ` Mark Cave-Ayland
2026-06-11 13:53     ` Peter Xu
2026-06-09 17:25 ` [PATCH v2 06/10] qom: Add object_property_add_bool_ptr() Peter Xu
2026-06-09 23:18   ` Fabiano Rosas
2026-06-11 12:59   ` Mark Cave-Ayland
2026-06-09 17:25 ` [PATCH v2 07/10] qom: Add object_property_add_size_ptr() Peter Xu
2026-06-09 23:18   ` Fabiano Rosas
2026-06-09 17:25 ` [PATCH v2 08/10] qom: Add object_property_add_*_ptr_def() Peter Xu
2026-06-09 23:21   ` Fabiano Rosas
2026-06-11 14:03   ` Mark Cave-Ayland
2026-06-09 17:25 ` [PATCH v2 09/10] qom: Allow default values for instance properties Peter Xu
2026-06-10 16:19   ` Daniel P. Berrangé
2026-06-11 14:08   ` Mark Cave-Ayland
2026-06-11 14:17     ` Daniel P. Berrangé
2026-06-11 15:24       ` Mark Cave-Ayland
2026-06-09 17:25 ` [PATCH v2 10/10] migration: Switch to TYPE_OBJECT with object properties Peter Xu
2026-06-10 16:13   ` Daniel P. Berrangé
2026-06-10 18:46     ` Peter Xu
2026-06-10 19:53       ` Fabiano Rosas
2026-06-10 20:18         ` Fabiano Rosas
2026-06-10 16:29   ` Daniel P. Berrangé
2026-06-10 18:51     ` Peter Xu
2026-06-09 22:54 ` [PATCH v2 00/10] migration/qom: Remove TYPE_DEVICE dependency on migration object Fabiano Rosas
2026-06-10 18:30   ` Peter Xu
2026-06-11 13:31     ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h5nb5noc.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=clg@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=jmarcin@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.caveayland@nutanix.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@mailo.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    --cc=sansshar@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox