From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH v4] tools: set migration constraints from cmdline Date: Mon, 4 Feb 2013 19:43:02 +0100 Message-ID: <20130204184301.GA31487@aepfle.de> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1359986349.7743.46.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org 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)? 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. 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