]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
tools/libxl: run_helper - add #define for arguments.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 26 Jan 2016 21:31:00 +0000 (16:31 -0500)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 3 Feb 2016 11:17:48 +0000 (11:17 +0000)
Describe what the four (or more in the future) arguments
are for.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
tools/libxl/libxl_save_callout.c

index 3af99af2e17d2370c28d50b899cd601de83ae64e..45b9727bdc891d1076a15f0576fae39267fea620 100644 (file)
@@ -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;