xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libxl: libxl_domain_create_restore has an extra argument
@ 2016-04-05 14:20 Wei Liu
  2016-04-05 14:28 ` Wei Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wei Liu @ 2016-04-05 14:20 UTC (permalink / raw)
  To: libvir-list; +Cc: cardoe, Ian Jackson, Wei Liu, Xen-devel

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.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
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(-)

diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 04962a0..aed904b 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -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,
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] libxl: libxl_domain_create_restore has an extra argument
  2016-04-05 14:20 [PATCH] libxl: libxl_domain_create_restore has an extra argument Wei Liu
@ 2016-04-05 14:28 ` Wei Liu
  2016-04-05 15:12   ` Ian Jackson
       [not found]   ` <22275.54777.889693.883970@mariner.uk.xensource.com>
  2016-04-06 21:43 ` Doug Goldstein
       [not found] ` <570582EB.4050305@cardoe.com>
  2 siblings, 2 replies; 7+ messages in thread
From: Wei Liu @ 2016-04-05 14:28 UTC (permalink / raw)
  To: libvir-list; +Cc: cardoe, Jim Fehlig, Ian Jackson, Wei Liu, Xen-devel

CC Jim as well

On Tue, Apr 05, 2016 at 03:20:12PM +0100, Wei Liu wrote:
> 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.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> 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(-)
> 
> diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> index 04962a0..aed904b 100644
> --- a/src/libxl/libxl_domain.c
> +++ b/src/libxl/libxl_domain.c
> @@ -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,
> -- 
> 2.1.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libxl: libxl_domain_create_restore has an extra argument
  2016-04-05 14:28 ` Wei Liu
@ 2016-04-05 15:12   ` Ian Jackson
       [not found]   ` <22275.54777.889693.883970@mariner.uk.xensource.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Ian Jackson @ 2016-04-05 15:12 UTC (permalink / raw)
  To: Wei Liu; +Cc: libvir-list, Xen-devel, Jim Fehlig, cardoe

Wei Liu writes ("Re: [PATCH] libxl: libxl_domain_create_restore has an extra argument"):
> CC Jim as well
> 
> On Tue, Apr 05, 2016 at 03:20:12PM +0100, Wei Liu wrote:
> > 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.
...
> > -#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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libxl: libxl_domain_create_restore has an extra argument
       [not found]   ` <22275.54777.889693.883970@mariner.uk.xensource.com>
@ 2016-04-06 11:24     ` Wei Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Liu @ 2016-04-06 11:24 UTC (permalink / raw)
  To: Ian Jackson; +Cc: libvir-list, cardoe, Jim Fehlig, Wei Liu, Xen-devel

On Tue, Apr 05, 2016 at 04:12:57PM +0100, Ian Jackson wrote:
> Wei Liu writes ("Re: [PATCH] libxl: libxl_domain_create_restore has an extra argument"):
> > CC Jim as well
> > 
> > On Tue, Apr 05, 2016 at 03:20:12PM +0100, Wei Liu wrote:
> > > 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.
> ...
> > > -#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.
> 

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

Wei.

> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libxl: libxl_domain_create_restore has an extra argument
  2016-04-05 14:20 [PATCH] libxl: libxl_domain_create_restore has an extra argument Wei Liu
  2016-04-05 14:28 ` Wei Liu
@ 2016-04-06 21:43 ` Doug Goldstein
       [not found] ` <570582EB.4050305@cardoe.com>
  2 siblings, 0 replies; 7+ messages in thread
From: Doug Goldstein @ 2016-04-06 21:43 UTC (permalink / raw)
  To: Wei Liu, libvir-list; +Cc: Xen-devel, Ian Jackson


[-- Attachment #1.1.1: Type: text/plain, Size: 1766 bytes --]

On 4/5/16 9:20 AM, Wei Liu wrote:
> 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.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> 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(-)
> 
> diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> index 04962a0..aed904b 100644
> --- a/src/libxl/libxl_domain.c
> +++ b/src/libxl/libxl_domain.c
> @@ -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,
> 

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.

-- 
Doug Goldstein


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 959 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [libvirt] [PATCH] libxl: libxl_domain_create_restore has an extra argument
       [not found] ` <570582EB.4050305@cardoe.com>
@ 2016-04-07 16:35   ` Daniel P. Berrange
  2016-04-07 17:44     ` Wei Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel P. Berrange @ 2016-04-07 16:35 UTC (permalink / raw)
  To: Doug Goldstein; +Cc: libvir-list, Xen-devel, Wei Liu, Ian Jackson

On Wed, Apr 06, 2016 at 04:43:07PM -0500, Doug Goldstein wrote:
> On 4/5/16 9:20 AM, Wei Liu wrote:
> > 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.
> > 
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > ---
> > 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(-)
> > 
> > diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> > index 04962a0..aed904b 100644
> > --- a/src/libxl/libxl_domain.c
> > +++ b/src/libxl/libxl_domain.c
> > @@ -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,
> > 
> 
> 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.

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



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 :|

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [libvirt] [PATCH] libxl: libxl_domain_create_restore has an extra argument
  2016-04-07 16:35   ` [libvirt] " Daniel P. Berrange
@ 2016-04-07 17:44     ` Wei Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Liu @ 2016-04-07 17:44 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: libvir-list, Wei Liu, Doug Goldstein, Ian Jackson, Xen-devel

On Thu, Apr 07, 2016 at 05:35:33PM +0100, Daniel P. Berrange wrote:
> On Wed, Apr 06, 2016 at 04:43:07PM -0500, Doug Goldstein wrote:
> > On 4/5/16 9:20 AM, Wei Liu wrote:
> > > 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.
> > > 
> > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > > ---
> > > 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(-)
> > > 
> > > diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> > > index 04962a0..aed904b 100644
> > > --- a/src/libxl/libxl_domain.c
> > > +++ b/src/libxl/libxl_domain.c
> > > @@ -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,
> > > 
> > 
> > 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.
> 
> It missed the boat for 1.3.3, but I've pushed it now
> 

Thank you very much for pushing this!

Wei.

> 
> 
> 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 :|

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-04-07 17:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-05 14:20 [PATCH] libxl: libxl_domain_create_restore has an extra argument Wei Liu
2016-04-05 14:28 ` Wei Liu
2016-04-05 15:12   ` Ian Jackson
     [not found]   ` <22275.54777.889693.883970@mariner.uk.xensource.com>
2016-04-06 11:24     ` Wei Liu
2016-04-06 21:43 ` Doug Goldstein
     [not found] ` <570582EB.4050305@cardoe.com>
2016-04-07 16:35   ` [libvirt] " Daniel P. Berrange
2016-04-07 17:44     ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).