summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-08-01 15:52:40 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-08-01 15:52:40 +0000
commit7954c73498b7e782ba5db2993637daef456b6310 (patch)
tree02b7c13682f70b4855b2369f3f9ecbc33c89995f /monitor.c
parent93b6b2a3cd2bf7844dd2a9000cb4feefe7b0f597 (diff)
downloadqemu-7954c73498b7e782ba5db2993637daef456b6310.zip
commit to specific devices
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2074 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/monitor.c b/monitor.c
index 09a0299fc7..b48e8cc702 100644
--- a/monitor.c
+++ b/monitor.c
@@ -167,13 +167,16 @@ static void do_help(const char *name)
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(bdrv_get_device_name(bs_table[i]), device))
+ bdrv_commit(bs_table[i]);
}
}
}
@@ -1138,8 +1141,8 @@ static void do_wav_capture (const char *path,
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) or backing files" },
{ "info", "s?", do_info,
"subcommand", "show various information about the system state" },
{ "q|quit", "", do_quit,