From patchwork Tue Jan 26 21:31:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 8127671 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E7E1E9FBE9 for ; Tue, 26 Jan 2016 21:33:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 274D020266 for ; Tue, 26 Jan 2016 21:33:57 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52B1920222 for ; Tue, 26 Jan 2016 21:33:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aOBCo-0004fm-54; Tue, 26 Jan 2016 21:31:18 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aOBCm-0004f8-Bz for xen-devel@lists.xenproject.org; Tue, 26 Jan 2016 21:31:16 +0000 Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id 2D/2B-31122-3A5E7A65; Tue, 26 Jan 2016 21:31:15 +0000 X-Env-Sender: konrad@char.us.oracle.com X-Msg-Ref: server-11.tower-21.messagelabs.com!1453843873!12247382!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51941 invoked from network); 26 Jan 2016 21:31:14 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 26 Jan 2016 21:31:14 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u0QLV8vx001299 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Jan 2016 21:31:08 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u0QLV4Gn004630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 26 Jan 2016 21:31:07 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u0QLV4Gm018402; Tue, 26 Jan 2016 21:31:04 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 26 Jan 2016 13:31:02 -0800 Received: by char.us.oracle.com (Postfix, from userid 1000) id ABB906A4BCF; Tue, 26 Jan 2016 16:31:01 -0500 (EST) From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, ian.campbell@citrix.com, wei.liu2@citrix.com, Ian.Jackson@eu.citrix.com Date: Tue, 26 Jan 2016 16:31:00 -0500 Message-Id: <1453843860-29591-5-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1453843860-29591-1-git-send-email-konrad.wilk@oracle.com> References: <1453843860-29591-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH 4/4] tools/libxl: run_helper - add #define for arguments. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Describe what the four (or more in the future) arguments are for. Acked-by: Ian Jackson 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;