All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: Gianni Tedesco <gianni.tedesco@citrix.com>
Cc: Christoph Egger <Christoph.Egger@amd.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [PATCH]: xl: Check a domain exists before destroying it
Date: Tue, 25 Jan 2011 17:07:12 +0000	[thread overview]
Message-ID: <19775.832.127719.521977@mariner.uk.xensource.com> (raw)
In-Reply-To: <1295891031.28333.25.camel@qabil.uk.xensource.com>

Gianni Tedesco writes ("[PATCH]: xl: Check a domain exists before destroying it"):
> This is quite a clever fix but I think Ian Jacksons comments are
> correct. We should do a libxl_domain_info() and bail early in the
> destroy path if that fails.

Thanks, I have applied the libxl part of this patch.

The xl_cmdimpl part:
> Also fix a mis-formatted error message in xl destroy command.
misses three other similar mistakes.

$ egrep '\\n.\"' tools/libxl/*.c
tools/libxl/xl_cmdimpl.c:    if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n.",rc); exit(-1); }
tools/libxl/xl_cmdimpl.c:    if (rc) { fprintf(stderr,"shutdown failed (rc=%d)\n.",rc);exit(-1); }
tools/libxl/xl_cmdimpl.c:    if (rc) { fprintf(stderr,"reboot failed (rc=%d)\n.",rc);exit(-1); }
tools/libxl/xl_cmdimpl.c:    if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n.",rc);exit(-1); }
$ 

Also in general most of the messages from xl don't print full stops.
So I suggest the patch below instead.

Ian.


xl: fix up some minor mistakes in error messages

perl -i~ -pe 's/\\n.\"/\\n\"/' tools/libxl/*.c

Reported-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

diff -r 787af706dadc tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Jan 25 17:02:47 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Jan 25 17:06:46 2011 +0000
@@ -2176,7 +2176,7 @@ static void destroy_domain(const char *p
         exit(-1);
     }
     rc = libxl_domain_destroy(&ctx, domid, 0);
-    if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n.",rc); exit(-1); }
+    if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n",rc); exit(-1); }
 }
 
 static void shutdown_domain(const char *p, int wait)
@@ -2185,7 +2185,7 @@ static void shutdown_domain(const char *
 
     find_domain(p);
     rc=libxl_domain_shutdown(&ctx, domid, 0);
-    if (rc) { fprintf(stderr,"shutdown failed (rc=%d)\n.",rc);exit(-1); }
+    if (rc) { fprintf(stderr,"shutdown failed (rc=%d)\n",rc);exit(-1); }
 
     if (wait) {
         libxl_waiter waiter;
@@ -2227,7 +2227,7 @@ static void reboot_domain(const char *p)
     int rc;
     find_domain(p);
     rc=libxl_domain_shutdown(&ctx, domid, 1);
-    if (rc) { fprintf(stderr,"reboot failed (rc=%d)\n.",rc);exit(-1); }
+    if (rc) { fprintf(stderr,"reboot failed (rc=%d)\n",rc);exit(-1); }
 }
 
 static void list_domains_details(const libxl_dominfo *info, int nb_domain)
@@ -2669,7 +2669,7 @@ static void core_dump_domain(const char 
     int rc;
     find_domain(domain_spec);
     rc=libxl_domain_core_dump(&ctx, domid, filename);
-    if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n.",rc);exit(-1); }
+    if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n",rc);exit(-1); }
 }
 
 static void migrate_receive(int debug, int daemonize)

  parent reply	other threads:[~2011-01-25 17:07 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Acu6GEBstpnTfIH/TdeQZvf0FjUZ0Q==>
2011-01-22  9:39 ` Xen 4.1 rc1 test report Zheng, Shaohui
2011-01-24 17:05   ` Xen 4.1 rc1 test report (xl bits) Gianni Tedesco
2011-01-24 17:27     ` Christoph Egger
2011-01-24 17:43       ` [PATCH]: xl: Check a domain exists before destroying it Gianni Tedesco
2011-01-24 18:18         ` [PATCH, v2]: xl: Check domain existance when doing domain identifier lookups Gianni Tedesco
2011-01-24 18:39           ` Stefano Stabellini
2011-01-24 18:53             ` Gianni Tedesco
2011-01-24 19:05               ` Stefano Stabellini
2011-01-25 17:29               ` Ian Jackson
2011-01-25 17:28           ` Ian Jackson
2011-01-25 17:35             ` Gianni Tedesco
2011-01-25 18:28               ` Ian Jackson
2011-01-25 17:07         ` Ian Jackson [this message]
2011-01-25 17:17           ` [PATCH]: xl: Check a domain exists before destroying it Gianni Tedesco
2011-01-25 18:25             ` Ian Jackson
2011-01-24 18:35     ` Xen 4.1 rc1 test report (xl bits) Stefano Stabellini
2011-01-25 14:04     ` Gianni Tedesco
2011-01-26  3:47       ` Zhang, Yang Z
2011-01-25  6:24   ` Xen 4.1 rc1 test report Haitao Shan
2011-01-25  8:00     ` Zheng, Shaohui
2011-01-25  8:43     ` Keir Fraser
2011-01-25 11:43     ` Ian Campbell
2011-01-26  0:47       ` Haitao Shan
2011-01-26 10:57         ` libxc: maintain a small, per-handle, cache of hypercall buffer memory (Was: Re: Xen 4.1 rc1 test report) Ian Campbell
2011-01-27  9:47           ` Ian Campbell
2011-01-31  0:58             ` Haitao Shan
2011-01-31  3:06           ` Haitao Shan
2011-01-31  8:30             ` Ian Campbell
2011-01-31  8:57               ` Haitao Shan
2011-01-31  9:32                 ` Ian Campbell
2011-01-31 12:07                   ` Haitao Shan
2011-02-01  4:40                     ` Haitao Shan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19775.832.127719.521977@mariner.uk.xensource.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=Christoph.Egger@amd.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=gianni.tedesco@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.