]>
Commit | Line | Data |
---|---|---|
6fb04df7 | 1 | From a88a0bf330a1ede68e867d7ae932b3ffd4d4911a Mon Sep 17 00:00:00 2001 |
ca0fe5f5 WB |
2 | From: Wolfgang Bumiller <w.bumiller@proxmox.com> |
3 | Date: Wed, 9 Dec 2015 16:32:39 +0100 | |
6fb04df7 | 4 | Subject: [PATCH 25/55] backup: vma: add BlockDriver to bdrv_open in |
ca0fe5f5 WB |
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 |