Skip to contentSkip to conversation

libxl: libxl_domain_create_restore has an extra argument

PATCH In review Wei Liu 4 participants 7 messages Apr 5, 2016 – Apr 7, 2016 2 messages not in the archive

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libxl: libxl_domain_create_restore has an extra argument

In the latest libxenlight code, libxl_domain_create_restore accepts a new argument. Update libvirt's libxl driver for that. Use the macro provided by libxenlight to detect which version should be used.

The new parameter (send_back_fd) is set to -1 because libvirt provides no such fd.

---
Build test with Xen 4.6.1 (old API) and Xen unstable (new API).

---
 src/libxl/libxl_domain.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/libxl/libxl_domain.c +6 -1
index 04962a0..aed904b 100644
@@ -1070,7 +1070,12 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(cfg->ctx, &d_config,
                                       &domid, NULL, &aop_console_how);
     } else {
-#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+#if defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD)
+        params.checkpointed_stream = 0;
+        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
+                                          restore_fd, -1, &params, NULL,
+                                          &aop_console_how);
+#elif defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS)
         params.checkpointed_stream = 0;
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, &params, NULL,
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#1 lore raw

CC Jim as well

Quoted 35 lines · Wei Liu

In the latest libxenlight code, libxl_domain_create_restore accepts a new argument. Update libvirt's libxl driver for that. Use the macro provided by libxenlight to detect which version should be used.

The new parameter (send_back_fd) is set to -1 because libvirt provides no such fd.

---
Build test with Xen 4.6.1 (old API) and Xen unstable (new API).

---
 src/libxl/libxl_domain.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/libxl/libxl_domain.c +6 -1
index 04962a0..aed904b 100644
@@ -1070,7 +1070,12 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(cfg->ctx, &d_config,
                                       &domid, NULL, &aop_console_how);
     } else {
-#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+#if defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD)
+        params.checkpointed_stream = 0;
+        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
+                                          restore_fd, -1, &params, NULL,
+                                          &aop_console_how);
+#elif defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS)
         params.checkpointed_stream = 0;
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, &params, NULL,
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw

Wei Liu writes ("Re: [PATCH] libxl: libxl_domain_create_restore has an extra argument"):

Quoted 9 lines

CC Jim as well

Quoted 6 lines · Wei Liu

In the latest libxenlight code, libxl_domain_create_restore accepts a new argument. Update libvirt's libxl driver for that. Use the macro provided by libxenlight to detect which version should be used.

The new parameter (send_back_fd) is set to -1 because libvirt provides no such fd.

...

Quoted 10 lines

src/libxl/libxl_domain.c libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, · line 1081

Quoted 10 lines
src/libxl/libxl_domain.c +6 -1
-#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+#if defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD)
+        params.checkpointed_stream = 0;
+        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
+                                          restore_fd, -1, &params, NULL,
+                                          &aop_console_how);
+#elif defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS)
         params.checkpointed_stream = 0;
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, &params, NULL,

Another approach would be

             ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                               restore_fd,
    #ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD
                                               -1,
    #endif
    #ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
                                               &params,
    #endif
                                               NULL, &aop_console_how);

But which to choose is a matter of taste.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw
Quoted 34 lines · Ian Jackson

Wei Liu writes ("Re: [PATCH] libxl: libxl_domain_create_restore has an extra argument"):

Quoted 9 lines

CC Jim as well

Quoted 6 lines · Wei Liu

In the latest libxenlight code, libxl_domain_create_restore accepts a new argument. Update libvirt's libxl driver for that. Use the macro provided by libxenlight to detect which version should be used.

The new parameter (send_back_fd) is set to -1 because libvirt provides no such fd.

...

Quoted 10 lines

src/libxl/libxl_domain.c libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, · line 1081

Quoted 10 lines
src/libxl/libxl_domain.c +6 -1
-#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+#if defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD)
+        params.checkpointed_stream = 0;
+        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
+                                          restore_fd, -1, &params, NULL,
+                                          &aop_console_how);
+#elif defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS)
         params.checkpointed_stream = 0;
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, &params, NULL,

Another approach would be

             ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                               restore_fd,
    #ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD
                                               -1,
    #endif
    #ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
                                               &params,
    #endif
                                               NULL, &aop_console_how);
Quoted 2 lines

But which to choose is a matter of taste.

I merely followed the existing style. Let's keep it that way for now.

Wei.

Quoted 1 line

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
In reply to Wei Liu
Quoted 23 lines · Wei Liu

In the latest libxenlight code, libxl_domain_create_restore accepts a new argument. Update libvirt's libxl driver for that. Use the macro provided by libxenlight to detect which version should be used.

The new parameter (send_back_fd) is set to -1 because libvirt provides no such fd.

---
Build test with Xen 4.6.1 (old API) and Xen unstable (new API).

---
 src/libxl/libxl_domain.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/libxl/libxl_domain.c +0 -0
index 04962a0..aed904b 100644
@@ -1070,7 +1070,12 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(cfg->ctx, &d_config,
                                       &domid, NULL, &aop_console_how);
     } else {

src/libxl/libxl_domain.c libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, · line 1081

Quoted 10 lines
src/libxl/libxl_domain.c +6 -1
-#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+#if defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD)
+        params.checkpointed_stream = 0;
+        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
+                                          restore_fd, -1, &params, NULL,
+                                          &aop_console_how);
+#elif defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS)
         params.checkpointed_stream = 0;
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, &params, NULL,

ACK

This fixes integration testing that Xen Project does with libvirt and Xen so it would be nice to get in for 1.3.3.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 37 lines · Doug Goldstein
Quoted 23 lines · Wei Liu

In the latest libxenlight code, libxl_domain_create_restore accepts a new argument. Update libvirt's libxl driver for that. Use the macro provided by libxenlight to detect which version should be used.

The new parameter (send_back_fd) is set to -1 because libvirt provides no such fd.

---
Build test with Xen 4.6.1 (old API) and Xen unstable (new API).

---
 src/libxl/libxl_domain.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/libxl/libxl_domain.c +0 -0
index 04962a0..aed904b 100644
@@ -1070,7 +1070,12 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(cfg->ctx, &d_config,
                                       &domid, NULL, &aop_console_how);
     } else {

src/libxl/libxl_domain.c libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, · line 1081

Quoted 10 lines
src/libxl/libxl_domain.c +6 -1
-#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+#if defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD)
+        params.checkpointed_stream = 0;
+        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
+                                          restore_fd, -1, &params, NULL,
+                                          &aop_console_how);
+#elif defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS)
         params.checkpointed_stream = 0;
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, &params, NULL,

ACK

Quoted 2 lines

This fixes integration testing that Xen Project does with libvirt and Xen so it would be nice to get in for 1.3.3.

It missed the boat for 1.3.3, but I've pushed it now

Regards,
Daniel

Signature · 9 lines
|: 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 :|

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#8 lore raw
Quoted 38 lines · Daniel P. Berrange
Quoted 37 lines · Doug Goldstein
Quoted 23 lines · Wei Liu

In the latest libxenlight code, libxl_domain_create_restore accepts a new argument. Update libvirt's libxl driver for that. Use the macro provided by libxenlight to detect which version should be used.

The new parameter (send_back_fd) is set to -1 because libvirt provides no such fd.

---
Build test with Xen 4.6.1 (old API) and Xen unstable (new API).

---
 src/libxl/libxl_domain.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/libxl/libxl_domain.c +0 -0
index 04962a0..aed904b 100644
@@ -1070,7 +1070,12 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(cfg->ctx, &d_config,
                                       &domid, NULL, &aop_console_how);
     } else {

src/libxl/libxl_domain.c libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, · line 1081

Quoted 10 lines
src/libxl/libxl_domain.c +6 -1
-#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+#if defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD)
+        params.checkpointed_stream = 0;
+        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
+                                          restore_fd, -1, &params, NULL,
+                                          &aop_console_how);
+#elif defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS)
         params.checkpointed_stream = 0;
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, &params, NULL,

ACK

Quoted 5 lines
Quoted 2 lines

This fixes integration testing that Xen Project does with libvirt and Xen so it would be nice to get in for 1.3.3.

It missed the boat for 1.3.3, but I've pushed it now

Thank you very much for pushing this!

Wei.

Quoted 9 lines

Regards,
Daniel

Signature · 4 lines
|: 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 :|

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel