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: zhanghailiang
Subject: Re: [Qemu-devel] Adding new migration-parameters - any easier way?
Date: Wed, 17 Jun 2015 18:46:24 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

Hi,

Is there any news about this discussion?
Is anyone working on it? ;)

Since the 'hard feature freeze' time is closer, we'd better to fix it in 2.4
before libvirt uses it.

I have sent a RFC patch "[RFC] migration: Re-implement 'migrate-set-parameters' to 
make it easily for extension"
http://patchwork.ozlabs.org/patch/482125/
Which just changes qmp command to
 '{ "execute": "migrate-set-parameters" , "arguments":
     { "compression": { "compress-level": 1 } } }',
Compared with its original way, it seems to be more easy for reading and 
extension, but
it can't address most problems discussed here...

Thanks,
zhanghailiang

On 2015/6/5 17:50, Dr. David Alan Gilbert 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


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








reply via email to

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