]> git.proxmox.com Git - pve-qemu-kvm.git/blob - debian/patches/pve/0025-backup-vma-add-BlockDriver-to-bdrv_open-in-extract_c.patch
adding 2.5 pve patches and left-over extra fixes
[pve-qemu-kvm.git] / debian / patches / pve / 0025-backup-vma-add-BlockDriver-to-bdrv_open-in-extract_c.patch
1 From 194ceac1b39413a6a1eaeb8da62188effe3b5742 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Wed, 9 Dec 2015 16:32:39 +0100
4 Subject: [PATCH 25/41] backup: vma: add BlockDriver to bdrv_open in
5 extract_content
6
7 ---
8 vma.c | 8 +++++++-
9 1 file changed, 7 insertions(+), 1 deletion(-)
10
11 diff --git a/vma.c b/vma.c
12 index 00f20b0..543e7d8 100644
13 --- a/vma.c
14 +++ b/vma.c
15 @@ -299,7 +299,13 @@ static int extract_content(int argc, char **argv)
16 }
17
18 BlockDriverState *bs = bdrv_new();
19 - if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, NULL, &errp)) {
20 +
21 + const char *tmp = g_strrstr(devfn, ".");
22 + const char *format = (tmp == NULL) ? "raw" : ++tmp;
23 +
24 + BlockDriver *drv = bdrv_find_format(format);
25 +
26 + if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, drv, &errp)) {
27 g_error("can't open file %s - %s", devfn,
28 error_get_pretty(errp));
29 }
30 --
31 2.1.4
32