]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/pve/0033-vma-bdrv_open-dropped-the-drv-parameter.patch
bump version to 2.6.2-2
[pve-qemu-kvm.git] / debian / patches / pve / 0033-vma-bdrv_open-dropped-the-drv-parameter.patch
CommitLineData
6fb04df7 1From c0ca2a0437b4d648df1b54513c9f22a7519a328a Mon Sep 17 00:00:00 2001
ca0fe5f5
WB
2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3Date: Thu, 10 Dec 2015 14:43:07 +0100
6fb04df7 4Subject: [PATCH 33/55] vma: bdrv_open dropped the drv parameter
ca0fe5f5
WB
5
6we now pass the 'drive' option via a qdict.
7As per commit:
86ebf9aa2ef: block: Drop drv parameter from bdrv_open()
9
10For-patch: introduce new vma archive format
11---
12 vma.c | 10 +++++-----
13 1 file changed, 5 insertions(+), 5 deletions(-)
14
15diff --git a/vma.c b/vma.c
16index 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 */
24
25 static void help(void)
26 {
27@@ -302,10 +303,10 @@ static int extract_content(int argc, char **argv)
28
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));
33
34- BlockDriver *drv = bdrv_find_format(format);
35-
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));
40 }
41@@ -534,11 +535,10 @@ static int create_archive(int argc, char **argv)
42 char *devname = NULL;
43 path = extract_devname(path, &devname, devcount++);
44
45- BlockDriver *drv = NULL;
46 Error *errp = NULL;
47 BlockDriverState *bs = bdrv_new();
48
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--
552.1.4
56