[libvirt] [PATCH RFC 2/2] libxl: add v3 migration w/o params
Joao Martins
joao.m.martins at oracle.com
Wed Sep 9 15:19:52 UTC 2015
On 09/09/2015 03:03 PM, Daniel P. Berrange wrote:
> On Tue, Sep 08, 2015 at 09:26:12AM +0100, Joao Martins wrote:
>> This patch introduces migration v3 without ext. params. Most of
>> the changes are mechanical and most of it is moving code and handling
>> of the arguments in different way. Functional-wise it works same way
>> as its "Params" variants.
>>
>> By having v3 migration we end up supporting older variants of
>> virDomainMigrateToURI which don't use v3 with params. The latter is
>> only supported by the latest virDomainMigrateToURI3, thus we
>> broaden the API support of migration in libxl e.g. ability to use
>> virDomainMigrateToURI2 and virDomainMigrate (in P2P mode).
>>
>> Signed-off-by: Joao Martins <joao.m.martins at oracle.com>
>> ---
>> src/libxl/libxl_driver.c | 213 +++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 213 insertions(+)
>
> Hmm, this is the same issue that VZ driver has. It is madness for
> us to make every virt driver re-implement the V3 non-params
> variants. We could provide some standard stub impls in a common
> file that simply pack the parameters into a virTypedParam array
> and then invoke the V3 params variant APIs. That way we have
> on impl for all drivers.
>
Initially I thought of implementing that way since it was "just" converting the
virTypedParams, but I thought libxl was the only driver affected.
> Would you like to create a file src/migration-helpers.c that
> contains impls of the domain(Prepare|Begin|Perform|Finish|Confirm)V3
> methods, that simply create a virTypedParam array, and then
> re-invoke domain(Prepare|Begin|Perform|Finish|Confirm)V3Params
> methods. Then update QEMU driver to use those, and then also
> use them in libxl
Definitely! I will repost it on my next series.
>
> eg this:
>
>> @@ -5254,10 +5462,15 @@ static virHypervisorDriver libxlHypervisorDriver = {
>> .nodeDeviceDetachFlags = libxlNodeDeviceDetachFlags, /* 1.2.3 */
>> .nodeDeviceReAttach = libxlNodeDeviceReAttach, /* 1.2.3 */
>> .nodeDeviceReset = libxlNodeDeviceReset, /* 1.2.3 */
>> + .domainMigrateBegin3 = libxlDomainMigrateBegin3, /* 1.2.20 */
>
> would just do
>
> + .domainMigrateBegin3 = stubDomainMigrateBegin3, /* 1.2.20 */
>
> where stubDomainMigrateBegin3 is the method from migration-helpers.c
>
>
>> .domainMigrateBegin3Params = libxlDomainMigrateBegin3Params, /* 1.2.6 */
>> + .domainMigratePrepare3 = libxlDomainMigratePrepare3, /* 1.2.20 */
>> .domainMigratePrepare3Params = libxlDomainMigratePrepare3Params, /* 1.2.6 */
>> + .domainMigratePerform3 = libxlDomainMigratePerform3, /* 1.2.20 */
>> .domainMigratePerform3Params = libxlDomainMigratePerform3Params, /* 1.2.6 */
>> + .domainMigrateFinish3 = libxlDomainMigrateFinish3, /* 1.2.20 */
>> .domainMigrateFinish3Params = libxlDomainMigrateFinish3Params, /* 1.2.6 */
>> + .domainMigrateConfirm3 = libxlDomainMigrateConfirm3, /* 1.2.20 */
>> .domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.6 */
>> .nodeGetSecurityModel = libxlNodeGetSecurityModel, /* 1.2.16 */
>> };
>> --
>
> Regards,
> Daniel
>
More information about the libvir-list
mailing list