diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-07-22 16:42:57 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-27 14:08:23 -0500 |
commit | 751c6a17042b5d011013d6963c0505d671cf708e (patch) | |
tree | 61a769ed1a1c16ebdfc1397ce9d775222dfa8e57 /monitor.c | |
parent | 8a14daa5a1ae22fcfc317f4727a88d6c15c39aae (diff) |
kill drives_table
First step cleaning up the drives handling. This one does nothing but
removing drives_table[], still it became seriously big.
drive_get_index() is gone and is replaced by drives_get() which hands
out DriveInfo pointers instead of a table index. This needs adaption in
*tons* of places all over.
The drives are now maintained as linked list.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -253,13 +253,15 @@ static void help_cmd(Monitor *mon, const char *name) static void do_commit(Monitor *mon, const char *device) { - int i, all_devices; + int all_devices; + DriveInfo *dinfo; 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); + TAILQ_FOREACH(dinfo, &drives, next) { + if (!all_devices) + if (!strcmp(bdrv_get_device_name(dinfo->bdrv), device)) + continue; + bdrv_commit(dinfo->bdrv); } } |