[pve-devel] [PATCH_V2] add BlockDevice type to prevent warning.

Wolfgang Link w.link at proxmox.com
Wed Jun 10 13:43:03 CEST 2015


From: "w.link at proxmox.com" <Wolfgang Link>

The raw_bsd.c insert a check to warn when mounting BD, what has no device type.

Signed-off-by: w.link at proxmox.com <Wolfgang Link>
---
 debian/patches/add_block_driver_type_to_extract | 23 +++++++++++++++++++++++
 debian/patches/series                           |  1 +
 2 files changed, 24 insertions(+)
 create mode 100644 debian/patches/add_block_driver_type_to_extract

diff --git a/debian/patches/add_block_driver_type_to_extract b/debian/patches/add_block_driver_type_to_extract
new file mode 100644
index 0000000..1172985
--- /dev/null
+++ b/debian/patches/add_block_driver_type_to_extract
@@ -0,0 +1,23 @@
+Index: qemu-kvm-devel/vma.c
+===================================================================
+--- qemu-kvm-devel.orig/vma.c
++++ qemu-kvm-devel/vma.c
+@@ -299,7 +299,17 @@ static int extract_content(int argc, cha
+             }
+ 
+             BlockDriverState *bs = bdrv_new();
+-            if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, NULL, &errp)) {
++
++	    char **tmp = g_strsplit(devfn, ".",10);
++	    int number = 0;
++	    for (;*tmp != NULL; tmp++, number++);
++	    tmp--;
++
++	    char *format = (number == 1) ? "raw" : *tmp;
++
++ 	    BlockDriver *drv = bdrv_find_format(format);
++
++	    if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, drv, &errp)) {
+                 g_error("can't open file %s - %s", devfn,
+                         error_get_pretty(errp));
+             }
diff --git a/debian/patches/series b/debian/patches/series
index f270864..292bba6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -31,3 +31,4 @@ gluster-backupserver.patch
 add-qmp-get-link-status.patch
 0001-friendlier-ai_flag-hints-for-ipv6-hosts.patch
 tcmalloc.patch
+add_block_driver_type_to_extract
-- 
2.1.4





More information about the pve-devel mailing list