qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Adding new migration-parameters - any easier way?


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] Adding new migration-parameters - any easier way?
Date: Fri, 5 Jun 2015 11:23:04 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

* Dr. David Alan Gilbert (address@hidden) wrote:
> Hi,
>   Is there any way that we could make it easier to add new migration
> parameters? The current way is complicated and error prone;
> as far as I can tell, to add a new parameter we need to:
> 
>   1) qapi-schema.json
>     a) Add to 'MigrationParameter' enum, include comment
>     b) Add to migrate-set-parameters
>     c) Add to MigrationParameters
>   2) Define the 'default' macro at the top of migration.c
>   3) Add the initialisation to migrate_get_current to set the default
>   4) qmp_migrate_set_parameters:
>     a) Add the 'has' and value arguments to qmp_migrate_set_parameters
>        *** Make really sure this matches the order in migrate-set-parameters!
>     b) Add a bounds check on the value
>     c) Set the value in the array if the has_ is true
>   5) Fixup migrate_init to preserve the parameter around the init
>   6) Add a bool and case entry to hmp_migrate_set_parameter and
>     pass to qmp_migrate_set_parameters
>        *** Make sure you get the order to qmp_migrate_set_parameters right
>   7) Fixup hmp_info_migrate_parameters

oh, and don't forget to:
  8) add the entries to qmp_query_migrate_parameters

(I forgot).

Dave
> 
> 
> The three separate changes needed in the qapi-schema.json seem odd,
> and the 'has'/value pairs on qmp_migrate_set_parameters is just a nightmare
> because there's nothing to check the ordering, and it's just getting
> a silly number of arguments to the function now (I've got 10
> parameters in one of my dev worlds, so that function has 21 arguments).
> 
> In my ideal world there would be:
>    a) One thing to add to qapi-schema.json
>    b) qmp_migrate_set_parameters would take an array pointer indexed
>       by the enum
>    c) A way to define the bounds so that we didn't have to manually
>       add the bound checking.
>    d) Something where I defined the default value
> 
> (I'm fairly sure earlier versions of migrate parameters patches
> managed (a) and possibly (b)).
> 
> Dave
> --
> Dr. David Alan Gilbert / address@hidden / Manchester, UK
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]