[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen master] block: Emit modules in bdrv_iterate_format()



commit eb0df69f50bd64454bcb9457e875cd52f00dced8
Author:     Max Reitz <mreitz@xxxxxxxxxx>
AuthorDate: Wed Oct 12 22:49:06 2016 +0200
Commit:     Max Reitz <mreitz@xxxxxxxxxx>
CommitDate: Fri Nov 11 15:56:22 2016 +0100

    block: Emit modules in bdrv_iterate_format()
    
    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 <mreitz@xxxxxxxxxx>
    Message-id: 20161012204907.25941-3-mreitz@xxxxxxxxxx
    Reviewed-by: Eric Blake <eblake@xxxxxxxxxx>
    Signed-off-by: Max Reitz <mreitz@xxxxxxxxxx>
---
 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++) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.