Commit 7954c73498b7e782ba5db2993637daef456b6310
1 parent
93b6b2a3
commit to specific devices
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2074 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
9 additions
and
6 deletions
monitor.c
@@ -167,13 +167,16 @@ static void do_help(const char *name) | @@ -167,13 +167,16 @@ static void do_help(const char *name) | ||
167 | help_cmd(name); | 167 | help_cmd(name); |
168 | } | 168 | } |
169 | 169 | ||
170 | -static void do_commit(void) | 170 | +static void do_commit(const char *device) |
171 | { | 171 | { |
172 | - int i; | ||
173 | - | 172 | + int i, all_devices; |
173 | + | ||
174 | + all_devices = !strcmp(device, "all"); | ||
174 | for (i = 0; i < MAX_DISKS; i++) { | 175 | for (i = 0; i < MAX_DISKS; i++) { |
175 | if (bs_table[i]) { | 176 | if (bs_table[i]) { |
176 | - bdrv_commit(bs_table[i]); | 177 | + if (all_devices || |
178 | + !strcmp(bdrv_get_device_name(bs_table[i]), device)) | ||
179 | + bdrv_commit(bs_table[i]); | ||
177 | } | 180 | } |
178 | } | 181 | } |
179 | } | 182 | } |
@@ -1138,8 +1141,8 @@ static void do_wav_capture (const char *path, | @@ -1138,8 +1141,8 @@ static void do_wav_capture (const char *path, | ||
1138 | static term_cmd_t term_cmds[] = { | 1141 | static term_cmd_t term_cmds[] = { |
1139 | { "help|?", "s?", do_help, | 1142 | { "help|?", "s?", do_help, |
1140 | "[cmd]", "show the help" }, | 1143 | "[cmd]", "show the help" }, |
1141 | - { "commit", "", do_commit, | ||
1142 | - "", "commit changes to the disk images (if -snapshot is used)" }, | 1144 | + { "commit", "s", do_commit, |
1145 | + "device|all", "commit changes to the disk images (if -snapshot is used) or backing files" }, | ||
1143 | { "info", "s?", do_info, | 1146 | { "info", "s?", do_info, |
1144 | "subcommand", "show various information about the system state" }, | 1147 | "subcommand", "show various information about the system state" }, |
1145 | { "q|quit", "", do_quit, | 1148 | { "q|quit", "", do_quit, |