diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2009-07-31 15:15:41 -0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-08-27 21:23:38 -0500 |
commit | 866c72bbb886293d26e01ef7ee4277ebd27c9efd (patch) | |
tree | 1872c51b29b9597523b1907141ef434ea8ab8b57 | |
parent | b8630e45f0ff32f90f9ab637cd2ff7d687f5a3af (diff) | |
download | qemu-866c72bbb886293d26e01ef7ee4277ebd27c9efd.zip qemu-866c72bbb886293d26e01ef7ee4277ebd27c9efd.tar.gz qemu-866c72bbb886293d26e01ef7ee4277ebd27c9efd.tar.bz2 |
Fix do_commit() behavior
Commit 751c6a17042b5d011013d6963c0505d671cf708e changed the monitor's
'commit' command to this behavior:
1. Any string you type as argument will cause do_commit() to
call bdrv_commit() to all devices
2. If you enter a device name, it will be the only one ignored
by do_commit() :)
The fix is to call bdrv_commit() to the specified device only and
ignore the others (when 'all' is not specified).
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | monitor.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -257,9 +257,10 @@ static void do_commit(Monitor *mon, const char *device) all_devices = !strcmp(device, "all"); for (i = 0; i < nb_drives; i++) { - if (all_devices || - !strcmp(bdrv_get_device_name(drives_table[i].bdrv), device)) - bdrv_commit(drives_table[i].bdrv); + if (!all_devices) + if (strcmp(bdrv_get_device_name(drives_table[i].bdrv), device)) + continue; + bdrv_commit(drives_table[i].bdrv); } } |