From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [PATCH 3/3] tools/libxl: run_helper - add #define for arguments. Date: Mon, 25 Jan 2016 16:06:57 -0500 Message-ID: <1453756017-8747-4-git-send-email-konrad.wilk@oracle.com> References: <1453756017-8747-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aNoM3-0000VD-6p for xen-devel@lists.xenproject.org; Mon, 25 Jan 2016 21:07:19 +0000 In-Reply-To: <1453756017-8747-1-git-send-email-konrad.wilk@oracle.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: xen-devel@lists.xenproject.org, ian.campbell@citrix.com, wei.liu2@citrix.com, ian.jackson@eu.citrix.com Cc: Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org Describe what the four (or more in the future) arguments are for. Signed-off-by: Konrad Rzeszutek Wilk --- tools/libxl/libxl_save_callout.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c index 3af99af..45b9727 100644 --- a/tools/libxl/libxl_save_callout.c +++ b/tools/libxl/libxl_save_callout.c @@ -119,13 +119,22 @@ void libxl__save_helper_init(libxl__save_helper_state *shs) /*----- helper execution -----*/ +/* + * Both save and restore share four parameters: + * 1) Path to libxl-save-helper. + * 2) --[restore|save]-domain. + * 3) stream file descriptor. + * n) save/restore specific parameters. + * 4) A \0 at the end. + */ +#define HELPER_NR_ARGS 4 static void run_helper(libxl__egc *egc, libxl__save_helper_state *shs, const char *mode_arg, int stream_fd, const int *preserve_fds, int num_preserve_fds, const unsigned long *argnums, int num_argnums) { STATE_AO_GC(shs->ao); - const char *args[4 + num_argnums]; + const char *args[HELPER_NR_ARGS + num_argnums]; const char **arg = args; int i, rc; -- 2.4.3