specify device_name for commit
PATCH 1/1 specify device_name for commit
Hello all!
With this patch only the specified device gets commited. Since this is my first attempt to send a patch to the list, please let me know what you think of it.
cheers
m.
Index: monitor.c
===================================================================
RCS file: /sources/qemu/qemu/monitor.c,v
retrieving revision 1.54
monitor.c +9 -6
@@ -24,6 +24,7 @@#include "vl.h" #include "disas.h" #include <dirent.h> +#include "block_int.h" //#define DEBUG //#define DEBUG_COMPLETION
@@ -167,13 +168,15 @@help_cmd (name); } -static void do_commit (void ) +static void do_commit (const char *device) { -int i; - +int i, all_devices; + + all_devices = !strcmp (device,"all" );for (i =0 ; i <MAX_DISKS ; i++) {if (bs_table[i]) { -bdrv_commit (bs_table[i]); +if (all_devices || !strcmp (bs_table[i]->device_name, device)) +bdrv_commit (bs_table[i]); } } }
@@ -1138,8 +1141,8 @@static term_cmd_t term_cmds[] = { {"help|?" ,"s?" , do_help,"[cmd]" ,"show the help" }, - {"commit" ,"" , do_commit, -"" ,"commit changes to the disk images (if -snapshot is used)" }, + {"commit" ,"s" , do_commit, +"device|all" ,"commit changes to the disk images (if -snapshot is used)" }, {"info" ,"s?" , do_info,"subcommand" ,"show various information about the system state" }, {"q|quit" ,"" , do_quit,