Revision 7954c734
b/monitor.c | ||
---|---|---|
167 | 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 | 175 |
for (i = 0; i < MAX_DISKS; i++) { |
175 | 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 | 1141 |
static term_cmd_t term_cmds[] = { |
1139 | 1142 |
{ "help|?", "s?", do_help, |
1140 | 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 | 1146 |
{ "info", "s?", do_info, |
1144 | 1147 |
"subcommand", "show various information about the system state" }, |
1145 | 1148 |
{ "q|quit", "", do_quit, |
Also available in: Unified diff