changeset 4:349bbbd3fbd5

added dumpxml command
author Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
date Mon, 12 Nov 2012 21:37:14 +0900
parents 203445eb53a8
children 9ecd833b9570
files ie-virsh.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ie-virsh.c	Mon Nov 12 12:25:04 2012 +0900
+++ b/ie-virsh.c	Mon Nov 12 21:37:14 2012 +0900
@@ -28,6 +28,7 @@
 #define list_command "/usr/bin/virsh list --all"
 #define start_command "start"
 #define stop_command "destroy"
+#define dumpxml_command "dumpxml"
 
 #define VMNAME_MAX (512)
 
@@ -80,7 +81,7 @@
 void 
 usage()
 {
-  printf("Usage: COMMAND [list|start|stop] [vm-name]\n");
+  printf("Usage: COMMAND [list|start|stop|xmldump] [vm-name]\n");
 }
 
 /* main(int argc, char **argv) - main process loop */
@@ -147,6 +148,10 @@
   if (execl(command, command, stop_command, argv[2], NULL) < 0) {
    perror("Execl:");
   }
+ } else if ( strncmp(argv[1], "dumpxml", 7) == 0 ) {
+  if (execl(command, command, dumpxml_command, argv[2], NULL) < 0) {
+   perror("Execl:");
+  }
  } else {
     usage();
     exit(1);