adding 2.5 pve patches and left-over extra fixes
[pve-qemu-kvm.git] / debian / patches / pve / 0033-vma-bdrv_open-dropped-the-drv-parameter.patch
blobae17be5c508f3ebf244506674e475117a1078d68
1 From fecf3abe8512f12a33f8250cfb4e2687c62d4105 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Thu, 10 Dec 2015 14:43:07 +0100
4 Subject: [PATCH 33/41] vma: bdrv_open dropped the drv parameter
6 we now pass the 'drive' option via a qdict.
7 As per commit:
8 6ebf9aa2ef: block: Drop drv parameter from bdrv_open()
10 For-patch: introduce new vma archive format
11 ---
12 vma.c | 10 +++++-----
13 1 file changed, 5 insertions(+), 5 deletions(-)
15 diff --git a/vma.c b/vma.c
16 index 543e7d8..cc48013 100644
17 --- a/vma.c
18 +++ b/vma.c
19 @@ -25,6 +25,7 @@
20 #include "qemu-common.h"
21 #include "qemu/error-report.h"
22 #include "qemu/main-loop.h"
23 +#include "sysemu/char.h" /* qstring_from_str */
25 static void help(void)
27 @@ -302,10 +303,10 @@ static int extract_content(int argc, char **argv)
29 const char *tmp = g_strrstr(devfn, ".");
30 const char *format = (tmp == NULL) ? "raw" : ++tmp;
31 + QDict *options = qdict_new();
32 + qdict_put(options, "driver", qstring_from_str(format));
34 - BlockDriver *drv = bdrv_find_format(format);
36 - if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, drv, &errp)) {
37 + if (errp || bdrv_open(&bs, devfn, NULL, options, flags, &errp)) {
38 g_error("can't open file %s - %s", devfn,
39 error_get_pretty(errp));
41 @@ -534,11 +535,10 @@ static int create_archive(int argc, char **argv)
42 char *devname = NULL;
43 path = extract_devname(path, &devname, devcount++);
45 - BlockDriver *drv = NULL;
46 Error *errp = NULL;
47 BlockDriverState *bs = bdrv_new();
49 - res = bdrv_open(&bs, path, NULL, NULL, BDRV_O_CACHE_WB , drv, &errp);
50 + res = bdrv_open(&bs, path, NULL, NULL, BDRV_O_CACHE_WB, &errp);
51 if (res < 0) {
52 unlink(archivename);
53 g_error("bdrv_open '%s' failed - %s", path, error_get_pretty(errp));
54 --
55 2.1.4