From bece54704bb081339a87233bbc5401f2892467be Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sat, 8 May 2010 09:25:32 +0100 Subject: [PATCH] fish: Make 'launch' function static. This commit makes the launch function static and private to 'fish.c', and changes the generator so the function is no longer called for the 'run/launch' command. --- fish/fish.c | 25 ++++++++++++------------- fish/fish.h | 1 - src/generator.ml | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index 2e8c751..461f55b 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -58,6 +58,7 @@ struct mp { static void add_drives (struct drv *drv); static void prepare_drives (struct drv *drv); static void mount_mps (struct mp *mp); +static int launch (void); static void interactive (void); static void shell_script (void); static void script (int prompt); @@ -77,18 +78,6 @@ int remote_control = 0; int exit_on_error = 1; int command_num = 0; -int -launch (guestfs_h *_g) -{ - assert (_g == g); - - if (guestfs_is_config (g)) { - if (guestfs_launch (g) == -1) - return -1; - } - return 0; -} - static void __attribute__((noreturn)) usage (int status) { @@ -436,7 +425,7 @@ main (int argc, char *argv[]) * guest and mount them. */ if (next_prepared_drive > 1 || mps != NULL) { - if (launch (g) == -1) exit (EXIT_FAILURE); + if (launch () == -1) exit (EXIT_FAILURE); prepare_drives (drvs); mount_mps (mps); } @@ -554,6 +543,16 @@ prepare_drives (struct drv *drv) } } +static int +launch (void) +{ + if (guestfs_is_config (g)) { + if (guestfs_launch (g) == -1) + return -1; + } + return 0; +} + static void interactive (void) { diff --git a/fish/fish.h b/fish/fish.h index 8cdce26..a9993b3 100644 --- a/fish/fish.h +++ b/fish/fish.h @@ -60,7 +60,6 @@ extern void free_strings (char **argv); extern int count_strings (char *const *argv); extern void print_strings (char *const *argv); extern void print_table (char *const *argv); -extern int launch (guestfs_h *); extern int is_true (const char *str); extern char **parse_string_list (const char *str); extern int xwrite (int fd, const void *buf, size_t len); diff --git a/src/generator.ml b/src/generator.ml index c01e265..31ef313 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -447,7 +447,7 @@ You probably don't want to call this function.")] *) let non_daemon_functions = test_functions @ [ - ("launch", (RErr, []), -1, [FishAlias "run"; FishAction "launch"], + ("launch", (RErr, []), -1, [FishAlias "run"], [], "launch the qemu subprocess", "\ -- 1.8.3.1