xl/libxl: make shutdown accept the long option --wait for -w
authorSander Eikelenboom <linux@eikelenboom.it>
Thu, 11 Oct 2012 10:52:09 +0000 (11:52 +0100)
committerSander Eikelenboom <linux@eikelenboom.it>
Thu, 11 Oct 2012 10:52:09 +0000 (11:52 +0100)
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>
docs/man/xl.pod.1
tools/libxl/xl_cmdimpl.c
tools/libxl/xl_cmdtable.c

index 25ce77737fe642739338a4d505f62daaec625c83..dd387c92ff711a8986ee2f17afed03f3fff9ef2b 100644 (file)
@@ -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.
 
index 93066d3e3c889ade56d3a767c382ffa401386dad..389b5f7e4aed3c7f1e66ac6dbd9c6bb601beeee4 100644 (file)
@@ -3709,8 +3709,12 @@ int main_shutdown(int argc, char **argv)
     int opt;
     int wait_for_it = 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;
index 85ea7689093ec15267cce7d4e08d22f084df5a98..b398c0a67af1901a0f0197a332dd7b6da9454164 100644 (file)
@@ -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,