Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: Devel

[PATCH 1 of 2 v2] xl: code motion of vncviewer() and `struct domain_create`

 

 

Xen devel RSS feed   Index | Next | Previous | View Threaded


Goncalo.Gomes at EU

May 14, 2012, 7:39 PM

Post #1 of 3 (40 views)
Permalink
[PATCH 1 of 2 v2] xl: code motion of vncviewer() and `struct domain_create`

tools/libxl/xl_cmdimpl.c | 50 ++++++++++++++++++++++++-----------------------
1 files changed, 26 insertions(+), 24 deletions(-)


Signed-off-by: Goncalo Gomes <Goncalo.Gomes [at] EU>

diff -r cd4dd23a831d -r 380d5f86dfdd tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Fri May 11 18:59:07 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c Tue May 15 02:26:51 2012 +0000
@@ -120,6 +120,24 @@ static const char *action_on_shutdown_na

#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;
@@ -186,6 +204,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;
@@ -1399,22 +1425,6 @@ static int preserve_domain(libxl_ctx *ct
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;
@@ -2175,14 +2185,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[] = {

_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


Ian.Campbell at citrix

May 15, 2012, 7:45 AM

Post #2 of 3 (35 views)
Permalink
Re: [PATCH 1 of 2 v2] xl: code motion of vncviewer() and `struct domain_create` [In reply to]

On Tue, 2012-05-15 at 03:39 +0100, Goncalo Gomes wrote:
> tools/libxl/xl_cmdimpl.c | 50 ++++++++++++++++++++++++-----------------------
> 1 files changed, 26 insertions(+), 24 deletions(-)
>
>
> Signed-off-by: Goncalo Gomes <Goncalo.Gomes [at] EU>

Committed-by: Ian Campbell <ian.campbell [at] citrix>

Thanks!

Not sure what tool you use to send, but it is usual to put the diffstat
after the commit + s-o-b and a "---" marker. This way the standard tools
(e.g. git am) knows not to include it in the commit message. In this
case I've done it by hand. I think hg email is a bit broken in this
regard (puts the diffstat at the top), in which case feel free not to
use the corresponding option next time.

Ian.

>
> diff -r cd4dd23a831d -r 380d5f86dfdd tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c Fri May 11 18:59:07 2012 +0100
> +++ b/tools/libxl/xl_cmdimpl.c Tue May 15 02:26:51 2012 +0000
> @@ -120,6 +120,24 @@ static const char *action_on_shutdown_na
>
> #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;
> @@ -186,6 +204,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;
> @@ -1399,22 +1425,6 @@ static int preserve_domain(libxl_ctx *ct
> 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;
> @@ -2175,14 +2185,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[] = {



_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


Goncalo.Gomes at EU

May 15, 2012, 9:07 AM

Post #3 of 3 (37 views)
Permalink
Re: [PATCH 1 of 2 v2] xl: code motion of vncviewer() and `struct domain_create` [In reply to]

On Tue, 15 May 2012, Ian Campbell wrote:

> On Tue, 2012-05-15 at 03:39 +0100, Goncalo Gomes wrote:
> > tools/libxl/xl_cmdimpl.c | 50 ++++++++++++++++++++++++-----------------------
> > 1 files changed, 26 insertions(+), 24 deletions(-)
> >
> >
> > Signed-off-by: Goncalo Gomes <Goncalo.Gomes [at] EU>
>
> Committed-by: Ian Campbell <ian.campbell [at] citrix>
>
> Thanks!
>
> Not sure what tool you use to send, but it is usual to put the diffstat
> after the commit + s-o-b and a "---" marker. This way the standard tools
> (e.g. git am) knows not to include it in the commit message. In this
> case I've done it by hand. I think hg email is a bit broken in this
> regard (puts the diffstat at the top), in which case feel free not to
> use the corresponding option next time.

Thanks for fixing this by hand, I used hg email, with the '-d' switch
to add the diffstat. I will defer from using it next time.

Goncalo

> Ian.
>
> >
> > diff -r cd4dd23a831d -r 380d5f86dfdd tools/libxl/xl_cmdimpl.c
> > --- a/tools/libxl/xl_cmdimpl.c Fri May 11 18:59:07 2012 +0100
> > +++ b/tools/libxl/xl_cmdimpl.c Tue May 15 02:26:51 2012 +0000
> > @@ -120,6 +120,24 @@ static const char *action_on_shutdown_na
> >
> > #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;
> > @@ -186,6 +204,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;
> > @@ -1399,22 +1425,6 @@ static int preserve_domain(libxl_ctx *ct
> > 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;
> > @@ -2175,14 +2185,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[] = {
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel

Xen devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.