[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 09/12] block: Emit modules in bdrv_iterate_format()
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 09/12] block: Emit modules in bdrv_iterate_format() |
Date: |
Fri, 11 Nov 2016 17:55:08 +0100 |
From: Max Reitz <address@hidden>
Some block drivers may not be loaded yet, but qemu supports them
nonetheless. bdrv_iterate_format() should report them, too.
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/block.c b/block.c
index 67c70c1..39ddea3 100644
--- a/block.c
+++ b/block.c
@@ -2822,6 +2822,24 @@ void bdrv_iterate_format(void (*it)(void *opaque, const
char *name),
}
}
+ for (i = 0; i < (int)ARRAY_SIZE(block_driver_modules); i++) {
+ const char *format_name = block_driver_modules[i].format_name;
+
+ if (format_name) {
+ bool found = false;
+ int j = count;
+
+ while (formats && j && !found) {
+ found = !strcmp(formats[--j], format_name);
+ }
+
+ if (!found) {
+ formats = g_renew(const char *, formats, count + 1);
+ formats[count++] = format_name;
+ }
+ }
+ }
+
qsort(formats, count, sizeof(formats[0]), qsort_strcmp);
for (i = 0; i < count; i++) {
--
1.8.3.1
- [Qemu-block] [PULL 00/12] Block layer patches for 2.8.0-rc0, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 01/12] block/nbd: Fix the leaked visitor, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 02/12] block/ssh: Code cleanup for unused parameter, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 03/12] hmp: Make block_stream set an explicit job ID, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 04/12] raw_bsd: move check to prevent overflow, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 05/12] raw_bsd: don't check size alignment when only offset is set, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 06/12] qcow2: Remove stale FIXME comment, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 07/12] nfs: Fix memory leak in nfs_file_create(), Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 08/12] block: Fix bdrv_iterate_format() sorting, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 09/12] block: Emit modules in bdrv_iterate_format(),
Kevin Wolf <=
- [Qemu-block] [PULL 11/12] iotests: Always use -machine accel=qtest, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 10/12] iotests: Skip test 162 if there is no SSH support, Kevin Wolf, 2016/11/11
- [Qemu-block] [PULL 12/12] raw-posix: Rename 'raw_s' to 'rs', Kevin Wolf, 2016/11/11