From: Ian Campbell Subject: Re: [PATCH v4] tools: set migration constraints from cmdline Date: Tue, 5 Feb 2013 09:22:53 +0000 Message-ID: <1360056173.7743.81.camel@zakaz.uk.xensource.com> References: <577b051fca174be9f7b3.1359394360@probook.site> <785c8f34e1f802106e53.1359747275@probook.site> <1359983463.7743.23.camel@zakaz.uk.xensource.com> <20130204134102.GC16090@aepfle.de> <1359985584.7743.39.camel@zakaz.uk.xensource.com> <20130204135553.GB16668@aepfle.de> <1359986349.7743.46.camel@zakaz.uk.xensource.com> <20130204184301.GA31487@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130204184301.GA31487@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2013-02-04 at 18:43 +0000, Olaf Hering wrote: > On Mon, Feb 04, Ian Campbell wrote: > > > It just occurred to me, instead of adding lots of individual arguments > > perhaps packing them into a (e.g.) libxl_save_properties and adding a > > pointer would be a nicer and more extensible (in the future) interface? > > Something like this (copy&paste from hg diff)? It's a tricky balance of what goes in the struct and what goes in the prototype but I didn't imagine putting domid or fd into the struct, domid because that's how other libxl APIs behave and fd because it isn't really a property of the save/migrate as such. Moving flags into the struct could be optional is it complicates the compat code too much. > I did not find a way to put also libxl_asyncop_how into > libxl_save_properties, the checker complains about missing > LIBXL_EXTERNAL_CALLERS_ONLY. I think this is fine to remain in the prototype alongside domid etc. > > Olaf > > diff -r 6087ff7a1aea tools/libxl/libxl.h > --- a/tools/libxl/libxl.h > +++ b/tools/libxl/libxl.h > @@ -500,18 +500,24 @@ int libxl_domain_create_restore(libxl_ct > void libxl_domain_config_init(libxl_domain_config *d_config); > void libxl_domain_config_dispose(libxl_domain_config *d_config); > > +typedef struct { > + uint32_t domid; > + int fd; > + int flags; /* LIBXL_SUSPEND_* */ > + int max_iters; > + int max_factor; > +} libxl_save_properties; > + > int libxl_domain_suspend_0x040200(libxl_ctx *ctx, uint32_t domid, int fd, > - int flags, /* LIBXL_SUSPEND_* */ > - const libxl_asyncop_how *ao_how) > - LIBXL_EXTERNAL_CALLERS_ONLY; > + int flags, /* LIBXL_SUSPEND_* */ > + const libxl_asyncop_how *ao_how) > + LIBXL_EXTERNAL_CALLERS_ONLY; > #ifdef LIBXL_API_VERSION > #if LIBXL_API_VERSION == 0x040200 > #define libxl_domain_suspend libxl_domain_suspend_0x040200 > #endif > #else > -int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, > - int flags, /* LIBXL_SUSPEND_* */ > - int max_iters, int max_factor, > +int libxl_domain_suspend(libxl_ctx *ctx, const libxl_save_properties *props, > const libxl_asyncop_how *ao_how) > LIBXL_EXTERNAL_CALLERS_ONLY; > #endif >