From: linux@eikelenboom.it
To: xen-devel@lists.xen.org
Cc: Sander Eikelenboom <linux@eikelenboom.it>, Ian.Campbell@citrix.com
Subject: [PATCH 3/3] xl/libxl: make shutdown accept the long option --wait for -w
Date: Thu, 11 Oct 2012 10:25:09 +0200 [thread overview]
Message-ID: <1349943909-2495-4-git-send-email-linux@eikelenboom.it> (raw)
In-Reply-To: <1349943909-2495-1-git-send-email-linux@eikelenboom.it>
From: Sander Eikelenboom <linux@eikelenboom.it>
Make xl/libxl accept the long option --wait for -w to be compatible with xm.
The long options are used in the default init and sysconfig scripts
Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
---
docs/man/xl.pod.1 | 2 +-
tools/libxl/xl_cmdimpl.c | 7 ++++++-
tools/libxl/xl_cmdtable.c | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 25ce777..dd387c9 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -550,7 +550,7 @@ B<OPTIONS>
=over 4
-=item B<-w>
+=item B<-w>, B<--wait>
Wait for the domain to complete shutdown before returning.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 93066d3..768ba1f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3709,8 +3709,13 @@ int main_shutdown(int argc, char **argv)
int opt;
int wait_for_it = 0;
int fallback_trigger = 0;
+ int option_index = 0;
+ static struct option long_options[] = {
+ {"wait", 0, 0, 'w'},
+ {0, 0, 0, 0}
+ };
- while ((opt = def_getopt(argc, argv, "wF", "shutdown", 1)) != -1) {
+ while ((opt = getopt_long(argc, argv, "wF", long_options, &option_index)) != -1) {
switch (opt) {
case 0: case 2:
return opt;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 85ea768..b398c0a 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -64,7 +64,7 @@ struct cmd_spec cmd_table[] = {
"-h Print this help.\n"
"-F Fallback to ACPI power event for HVM guests with\n"
" no PV drivers.\n"
- "-w Wait for guest to shutdown.\n"
+ "-w, --wait Wait for guest to shutdown.\n"
},
{ "reboot",
&main_reboot, 0, 1,
--
1.7.2.5
next prev parent reply other threads:[~2012-10-11 8:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 8:25 Fix xl shutdown and init / sysconfig behaviour linux
2012-10-11 8:25 ` [PATCH 1/3] init/sysconfig scripts: Remove --halt/-H option for shutdown command linux
2012-10-11 8:52 ` Ian Campbell
2012-10-11 9:05 ` Christoph Egger
2012-10-11 10:52 ` Ian Campbell
2012-10-11 8:25 ` [PATCH 2/3] init scripts: xendomains correct order of options " linux
2012-10-11 9:21 ` Ian Campbell
2012-10-11 8:25 ` linux [this message]
2012-10-11 8:58 ` [PATCH 3/3] xl/libxl: make shutdown accept the long option --wait for -w Ian Campbell
2012-10-11 10:25 ` [PATCH v2 " linux
2012-10-11 10:52 ` Ian Campbell
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=1349943909-2495-4-git-send-email-linux@eikelenboom.it \
--to=linux@eikelenboom.it \
--cc=Ian.Campbell@citrix.com \
--cc=xen-devel@lists.xen.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).