All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com, ppandit@redhat.com
Subject: Re: [PATCH v2 8/9] migration/options: Stop freeing s->parameters members individually
Date: Fri, 06 Feb 2026 16:50:15 -0300	[thread overview]
Message-ID: <87343dd53c.fsf@suse.de> (raw)
In-Reply-To: <aYYU5fbU5l4grFav@x1.local>

Peter Xu <peterx@redhat.com> writes:

> On Fri, Feb 06, 2026 at 09:29:04AM -0300, Fabiano Rosas wrote:
>> There's some amount of rigidness caused by qdev requirements
>> unfortunately.
>> 
>> I'm not sure if I ever posted it, but I wrote some code to move the
>> parameters into a MigrationOptions object so we could make
>> MigrationState not be a TYPE_DEVICE anymore. But then we'd end up with
>> something like -global migration-options by default, so it kinda killed
>> the idea.
>
> It's not strictly about TYPE_DEVICE, but reusing of qdev properties, right?
> At least the issue described by your comment was about offseting and it
> sounds like so.
>

Absolutely, I was just rambling.

Of course, TYPE_DEVICE brings us weirdness such as:

(qemu) device_add migration,help                             
migration options:                                           
  announce-initial=<size> -  (default: 50)         
  announce-max=<size>    -  (default: 550)        
  announce-rounds=<size> -  (default: 5)    
...

So it would be nice to drop this dependency.

> I just want to double check with you that I think the problem you described
> will also present even after applying my other series:
>
> https://lore.kernel.org/r/20251209162857.857593-1-peterx@redhat.com
>
> That series only removes the TYPE_DEVICE dependency, but not qdev
> properties.  I think it's the qdev property trick that is relevant at least
> to the offset issue you mentioned so MigrationParameters cannot be
> g_new()ed.
>
> The major use case for this qdev reuse is: (1) help scripting, so as to use
> -global migration.XXX=YYY, (2) support migration in machine compat
> properties.  IIUC (1) isn't a major thing we ask for (again, maybe I used
> the most of it.. but maybe only me; I'm not sure..), as long as anything
> can keep (2) working then we can consider.

The properties are also useful in providing defaults for the migration
options and perhaps we could make use of the .get/.set methods in a more
convenient way in the migration code, such as implementing per-option
input validation instead of checking all options always. (although I
haven't thought about the overlap with QAPI)

About -global, we should do better to separate the compat options from
the regular options. (and no, a blank line in options.c is not enough
separation!). I worry someday we'll break something in compat while
trying to change the regular options.

Another point is that even after all the recent changes to options.c, we
are still left with a list of migration_properties that is optional to
use. Which means setting defaults is also optional.

If we decide to retroactively add a default we'll suddenly have a new
option showing up in -global! Having to discover mid-way through the
implementation of a new migration feature that setting a default like
the other options do will also add property code to your option and now
you have one more source of SIGSEGV is not super fun either.

I had the intention to somehow force every option to have an equivalent
in migration_properties so that every option would have a default
explicitly set, but seeing the recent work on fixing the StrOrNull
property, I don't think it's worth it to ask that people go through the
hassle of implementing a property (when the new option cannot use the
existing types).



  reply	other threads:[~2026-02-06 19:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 22:40 [PATCH v2 0/9] qapi: Use visitors for migration parameters handling Fabiano Rosas
2026-02-02 22:40 ` [PATCH v2 1/9] migration/options.c: Don't export migrate_tls_opts_free Fabiano Rosas
2026-02-05 20:19   ` Peter Xu
2026-02-02 22:40 ` [PATCH v2 2/9] migration: Use QAPI_CLONE_MEMBERS in migrate_params_test_apply Fabiano Rosas
2026-02-05 20:19   ` Peter Xu
2026-02-02 22:40 ` [PATCH v2 3/9] migration: Use QAPI_CLONE_MEMBERS in migrate_params_apply Fabiano Rosas
2026-02-02 22:40 ` [PATCH v2 4/9] qapi: Implement qapi_dealloc_present_visitor Fabiano Rosas
2026-02-05 21:45   ` Peter Xu
2026-02-06 12:19     ` Fabiano Rosas
2026-02-06 17:38       ` Peter Xu
2026-02-02 22:40 ` [PATCH v2 5/9] qapi: Add QAPI_MERGE Fabiano Rosas
2026-02-13 14:57   ` Markus Armbruster
2026-02-02 22:40 ` [PATCH v2 6/9] migration/options: Use QAPI_MERGE in migrate_params_test_apply Fabiano Rosas
2026-02-02 22:40 ` [PATCH v2 7/9] migration/options: Open code migrate_params_apply Fabiano Rosas
2026-02-05 22:14   ` Peter Xu
2026-02-06 12:25     ` Fabiano Rosas
2026-02-02 22:41 ` [PATCH v2 8/9] migration/options: Stop freeing s->parameters members individually Fabiano Rosas
2026-02-05 22:16   ` Peter Xu
2026-02-06 12:29     ` Fabiano Rosas
2026-02-06 16:20       ` Peter Xu
2026-02-06 19:50         ` Fabiano Rosas [this message]
2026-02-09 15:37           ` Peter Xu
2026-02-02 22:41 ` [PATCH v2 9/9] migration: Use migrate_params_free during finalize Fabiano Rosas
2026-02-05 22:21   ` Peter Xu
2026-02-05 22:05 ` [PATCH v2 0/9] qapi: Use visitors for migration parameters handling Peter Xu
2026-02-06 12:34   ` Fabiano Rosas
2026-02-06 17:40     ` Peter Xu
2026-02-06 18:36       ` Fabiano Rosas

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=87343dd53c.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=armbru@redhat.com \
    --cc=peterx@redhat.com \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.