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
9 1 file changed, 7 insertions(+), 1 deletion(-)
11 diff --git a/vma.c b/vma.c
12 index 00f20b0..543e7d8 100644
15 @@ -299,7 +299,13 @@ static int extract_content(int argc, char **argv)
18 BlockDriverState *bs = bdrv_new();
19 - if (errp || bdrv_open(&bs, devfn, NULL, NULL, flags, NULL, &errp)) {
21 + const char *tmp = g_strrstr(devfn, ".");
22 + const char *format = (tmp == NULL) ? "raw" : ++tmp;
24 + BlockDriver *drv = bdrv_find_format(format);
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));