[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4] tools: set migration constraints from cmdline
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 > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |