aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSander Eikelenboom <linux@eikelenboom.it>2012-10-26 16:48:10 +0100
committerSander Eikelenboom <linux@eikelenboom.it>2012-10-26 16:48:10 +0100
commitc3f3a3c092315e3eeee0b2cb0ba3e2ce02a3a2dc (patch)
treeb19cb9b02b73d1eace46c9928be24843e6f22b82
parent14c081c8b94a8e4b1878c7a80fabe7a61c239d3b (diff)
downloadxen-c3f3a3c092315e3eeee0b2cb0ba3e2ce02a3a2dc.tar.gz
xen-c3f3a3c092315e3eeee0b2cb0ba3e2ce02a3a2dc.tar.bz2
xen-c3f3a3c092315e3eeee0b2cb0ba3e2ce02a3a2dc.zip
xl/libxl: make shutdown accept the long option --wait for -w
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> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com> xen-unstable changeset: 26045:ba7198bfc679 Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--docs/man/xl.pod.12
-rw-r--r--tools/libxl/xl_cmdimpl.c6
-rw-r--r--tools/libxl/xl_cmdtable.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 25ce77737f..dd387c92ff 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 c997015383..77804261cc 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3683,8 +3683,12 @@ int main_shutdown(int argc, char **argv)
int opt;
int wait = 0;
int fallback_trigger = 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, NULL)) != -1) {
switch (opt) {
case 0: case 2:
return opt;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 85ea768909..b398c0a67a 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,