]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/backup-vma-extract-add-block-driver-type.patch
Two more fixes
[pve-qemu-kvm.git] / debian / patches / backup-vma-extract-add-block-driver-type.patch
CommitLineData
e6d9a8cb 1Index: new/vma.c
9637ae00 2===================================================================
e6d9a8cb
DM
3--- new.orig/vma.c
4+++ new/vma.c
9637ae00 5@@ -299,7 +299,13 @@ static int extract_content(int argc, cha
6 }
7
8 BlockDriverState *bs = bdrv_new();
9- if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, NULL, &errp)) {
10+
e6d9a8cb
DM
11+ const char *tmp = g_strrstr(devfn, ".");
12+ const char *format = (tmp == NULL) ? "raw" : ++tmp;
9637ae00 13+
14+ BlockDriver *drv = bdrv_find_format(format);
15+
16+ if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, drv, &errp)) {
17 g_error("can't open file %s - %s", devfn,
18 error_get_pretty(errp));
19 }