* [Qemu-devel] [6703] block: Improve bdrv_iterate (Jan Kiszka)
@ 2009-03-05 23:00 Anthony Liguori
0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-03-05 23:00 UTC (permalink / raw)
To: qemu-devel
Revision: 6703
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6703
Author: aliguori
Date: 2009-03-05 23:00:43 +0000 (Thu, 05 Mar 2009)
Log Message:
-----------
block: Improve bdrv_iterate (Jan Kiszka)
Make bdrv_iterate more useful by passing the BlockDriverState to the
iterator instead of the device name.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/block.c
trunk/block.h
trunk/monitor.c
Modified: trunk/block.c
===================================================================
--- trunk/block.c 2009-03-05 23:00:29 UTC (rev 6702)
+++ trunk/block.c 2009-03-05 23:00:43 UTC (rev 6703)
@@ -1011,12 +1011,12 @@
return NULL;
}
-void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque)
+void bdrv_iterate(void (*it)(void *opaque, BlockDriverState *bs), void *opaque)
{
BlockDriverState *bs;
for (bs = bdrv_first; bs != NULL; bs = bs->next) {
- it(opaque, bs->device_name);
+ it(opaque, bs);
}
}
Modified: trunk/block.h
===================================================================
--- trunk/block.h 2009-03-05 23:00:29 UTC (rev 6702)
+++ trunk/block.h 2009-03-05 23:00:43 UTC (rev 6703)
@@ -141,7 +141,8 @@
void (*change_cb)(void *opaque), void *opaque);
void bdrv_get_format(BlockDriverState *bs, char *buf, int buf_size);
BlockDriverState *bdrv_find(const char *name);
-void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque);
+void bdrv_iterate(void (*it)(void *opaque, BlockDriverState *bs),
+ void *opaque);
int bdrv_is_encrypted(BlockDriverState *bs);
int bdrv_set_key(BlockDriverState *bs, const char *key);
void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
Modified: trunk/monitor.c
===================================================================
--- trunk/monitor.c 2009-03-05 23:00:29 UTC (rev 6702)
+++ trunk/monitor.c 2009-03-05 23:00:43 UTC (rev 6703)
@@ -2679,8 +2679,9 @@
closedir(ffs);
}
-static void block_completion_it(void *opaque, const char *name)
+static void block_completion_it(void *opaque, BlockDriverState *bs)
{
+ const char *name = bdrv_get_device_name(bs);
const char *input = opaque;
if (input[0] == '\0' ||
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-05 23:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-05 23:00 [Qemu-devel] [6703] block: Improve bdrv_iterate (Jan Kiszka) Anthony Liguori
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.