X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_usr%2Fv3_stop.c;h=061cd2809fd27e5f516542490e96d66e8526df1a;hb=33a5c8f83ba79ece7a76cf7c4d53bdeae1e30f07;hp=b47347d6c5c17f76d131feca78983b953eb2015a;hpb=4801e692b7344051eb94fff6faf1be53f621d422;p=palacios.git diff --git a/linux_usr/v3_stop.c b/linux_usr/v3_stop.c index b47347d..061cd28 100644 --- a/linux_usr/v3_stop.c +++ b/linux_usr/v3_stop.c @@ -18,25 +18,28 @@ int read_file(int fd, int size, unsigned char * buf); int main(int argc, char* argv[]) { - char * filename = argv[1]; int vm_fd = 0; - + unsigned long vm_idx = 0; + if (argc <= 1) { - printf("Usage: ./v3_stop \n"); + printf("Usage: ./v3_stop \n"); return -1; } + + vm_idx = atoi(argv[1]); + printf("Stopping VM\n"); - vm_fd = open(filename, O_RDONLY); + vm_fd = open("/dev/v3vee", O_RDONLY); if (vm_fd == -1) { printf("Error opening V3Vee VM device\n"); return -1; } - ioctl(vm_fd, V3_VM_STOP, NULL); + ioctl(vm_fd, V3_STOP_GUEST, vm_idx);