summaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-06-02 18:55:18 +0200
committerKevin Wolf <kwolf@redhat.com>2010-06-15 09:41:59 +0200
commit6ab4b5ab8f129df67708be4b58bdf0e13b178548 (patch)
treef960c0b69f7bda65987c7aafedc14ab2f85ff0cf /blockdev.c
parentabd7f68d081ef5adb425f659c7449149987bf89e (diff)
block: Decouple block device "commit all" from DriveInfo
do_commit() and mux_proc_byte() iterate over the list of drives defined with drive_init(). This misses host block devices defined by other means. Such means don't exist now, but will be introduced later in this series. Change them to use new bdrv_commit_all(), which iterates over all host block devices. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/blockdev.c b/blockdev.c
index b5570f403f..d74cd1d802 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -486,16 +486,16 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
void do_commit(Monitor *mon, const QDict *qdict)
{
- int all_devices;
- DriveInfo *dinfo;
const char *device = qdict_get_str(qdict, "device");
+ BlockDriverState *bs;
- all_devices = !strcmp(device, "all");
- QTAILQ_FOREACH(dinfo, &drives, next) {
- if (!all_devices)
- if (strcmp(bdrv_get_device_name(dinfo->bdrv), device))
- continue;
- bdrv_commit(dinfo->bdrv);
+ if (!strcmp(device, "all")) {
+ bdrv_commit_all();
+ } else {
+ bs = bdrv_find(device);
+ if (bs) {
+ bdrv_commit(bs);
+ }
}
}