[libvirt] [PATCH RFC 2/2] libxl: add v3 migration w/o params

Daniel P. Berrange berrange at redhat.com
Wed Sep 9 14:03:19 UTC 2015


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.

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


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
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list