diff --git a/block.c b/block.c index 892c47ad8124bb41cf47dfacb12890b439c0a543..6bbc389ff0d3462078bbd43349a73e4522e3be80 100644 --- a/block.c +++ b/block.c @@ -1011,12 +1011,12 @@ BlockDriverState *bdrv_find(const char *name) 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); } } diff --git a/block.h b/block.h index e1927dd1d726df5c866fa81f8fe4ac1e6550557f..aa26ef398230335909badcb2e493a2c054ec6ed4 100644 --- a/block.h +++ b/block.h @@ -141,7 +141,8 @@ void bdrv_set_change_cb(BlockDriverState *bs, 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), diff --git a/monitor.c b/monitor.c index 513eca9daae1c13559943d752115bd4c5ad12c96..2d1b86e3c75b5ae5e8636068bf55a0bd8b969f97 100644 --- a/monitor.c +++ b/monitor.c @@ -2679,8 +2679,9 @@ static void file_completion(const char *input) 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' ||