From: Goncalo Gomes Date: Tue, 15 May 2012 14:41:52 +0000 (+0100) Subject: xl: code motion of vncviewer() and `struct domain_create` X-Git-Tag: 4.2.0-rc1~350 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=705407c84cb08fc1d3fb02f92c2f3ad5749f1efc;p=xen.git xl: code motion of vncviewer() and `struct domain_create` Signed-off-by: Goncalo Gomes Committed-by: Ian Campbell --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index edfe462ab6..073ab6f03f 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -122,6 +122,24 @@ static const char *action_on_shutdown_names[] = { #define SAVEFILE_BYTEORDER_VALUE ((uint32_t)0x01020304UL) +struct domain_create { + int debug; + int daemonize; + int monitor; /* handle guest reboots etc */ + int paused; + int dryrun; + int quiet; + int console_autoconnect; + const char *config_file; + const char *extra_config; /* extra config string */ + const char *restore_file; + int migrate_fd; /* -1 means none */ + char **migration_domname_r; /* from malloc */ + int incr_generationid; +}; + + + static int qualifier_to_id(const char *p, uint32_t *id_r) { int i, alldigit; @@ -188,6 +206,14 @@ static void find_domain(const char *p) common_domname = was_name ? p : libxl_domid_to_name(ctx, domid); } +static int vncviewer(const char *domain_spec, int autopass) +{ + find_domain(domain_spec); + libxl_vncviewer_exec(ctx, domid, autopass); + fprintf(stderr, "Unable to execute vncviewer\n"); + return 1; +} + static int acquire_lock(void) { int rc; @@ -1418,22 +1444,6 @@ static int preserve_domain(libxl_ctx *ctx, uint32_t domid, libxl_event *event, return rc == 0 ? 1 : 0; } -struct domain_create { - int debug; - int daemonize; - int monitor; /* handle guest reboots etc */ - int paused; - int dryrun; - int quiet; - int console_autoconnect; - const char *config_file; - const char *extra_config; /* extra config string */ - const char *restore_file; - int migrate_fd; /* -1 means none */ - char **migration_domname_r; /* from malloc */ - int incr_generationid; -}; - static int freemem(libxl_domain_build_info *b_info) { int rc, retries = 3; @@ -2220,14 +2230,6 @@ int main_console(int argc, char **argv) return 1; } -static int vncviewer(const char *domain_spec, int autopass) -{ - find_domain(domain_spec); - libxl_vncviewer_exec(ctx, domid, autopass); - fprintf(stderr, "Unable to execute vncviewer\n"); - return 1; -} - int main_vncviewer(int argc, char **argv) { static const struct option long_options[] = {