[libvirt] [PATCH] fix api changes in xen restore

in recently xen commit: 7051d5c8, there is a api changes in libxl_domain_create_restore. Author: Andrew Cooper <andrew.cooper3@citrix.com> Date: Thu Oct 10 12:23:10 2013 +0100 tools/migrate: Fix regression when migrating from older version of Xen use the macro LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS in libxl.h in order to make libvirt could compile with old and new xen. the params checkpointed_stream is useful if libvirt libxl driver support migration. for new, set it as zero. Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com> --- src/libxl/libxl_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 4928695..104ad31 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -555,6 +555,9 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, int managed_save_fd = -1; libxlDomainObjPrivatePtr priv = vm->privateData; libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); +#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS + libxl_domain_restore_params params; +#endif if (libxlDomainObjPrivateInitCtx(vm) < 0) goto error; @@ -619,8 +622,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, ret = libxl_domain_create_new(priv->ctx, &d_config, &domid, NULL, NULL); else +#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS + params.checkpointed_stream = 0; + ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid, + restore_fd, ¶ms, NULL, NULL); +#else ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid, restore_fd, NULL, NULL); +#endif if (ret) { if (restore_fd < 0) -- 1.8.1.4

On Fri, Nov 01, 2013 at 03:26:26PM +0800, Bamvor Jian Zhang wrote:
in recently xen commit: 7051d5c8, there is a api changes in libxl_domain_create_restore. Author: Andrew Cooper <andrew.cooper3@citrix.com> Date: Thu Oct 10 12:23:10 2013 +0100
tools/migrate: Fix regression when migrating from older version of Xen
use the macro LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS in libxl.h in order to make libvirt could compile with old and new xen.
the params checkpointed_stream is useful if libvirt libxl driver support migration. for new, set it as zero.
Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com> --- src/libxl/libxl_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 4928695..104ad31 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -555,6 +555,9 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, int managed_save_fd = -1; libxlDomainObjPrivatePtr priv = vm->privateData; libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); +#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS + libxl_domain_restore_params params; +#endif
if (libxlDomainObjPrivateInitCtx(vm) < 0) goto error; @@ -619,8 +622,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, ret = libxl_domain_create_new(priv->ctx, &d_config, &domid, NULL, NULL); else +#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS + params.checkpointed_stream = 0; + ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid, + restore_fd, ¶ms, NULL, NULL); +#else ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid, restore_fd, NULL, NULL); +#endif
if (ret) { if (restore_fd < 0)
ACK 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 :|

On 11/01/2013 03:57 AM, Daniel P. Berrange wrote:
On Fri, Nov 01, 2013 at 03:26:26PM +0800, Bamvor Jian Zhang wrote:
in recently xen commit: 7051d5c8, there is a api changes in libxl_domain_create_restore. Author: Andrew Cooper <andrew.cooper3@citrix.com> Date: Thu Oct 10 12:23:10 2013 +0100
tools/migrate: Fix regression when migrating from older version of Xen
use the macro LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS in libxl.h in order to make libvirt could compile with old and new xen.
the params checkpointed_stream is useful if libvirt libxl driver support migration. for new, set it as zero.
Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com> --- src/libxl/libxl_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 4928695..104ad31 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -555,6 +555,9 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, int managed_save_fd = -1; libxlDomainObjPrivatePtr priv = vm->privateData; libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); +#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS + libxl_domain_restore_params params; +#endif
if (libxlDomainObjPrivateInitCtx(vm) < 0) goto error; @@ -619,8 +622,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, ret = libxl_domain_create_new(priv->ctx, &d_config, &domid, NULL, NULL); else +#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS + params.checkpointed_stream = 0; + ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid, + restore_fd, ¶ms, NULL, NULL); +#else ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid, restore_fd, NULL, NULL); +#endif
if (ret) { if (restore_fd < 0) ACK
Bamvor, thanks for the patch. Daniel, thanks for the review. I've pushed this for 1.1.4 since it is a build-breaker with xen-unstable. Regards, Jim
participants (3)
-
Bamvor Jian Zhang
-
Daniel P. Berrange
-
Jim Fehlig