-From 0d4b69786584eec1386183b259c22f7cae6df69d Mon Sep 17 00:00:00 2001
+From 7e3891e9d570f0c432bcfd076c17eb742e0e1350 Mon Sep 17 00:00:00 2001
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
Date: Fri, 1 Jul 2016 15:47:29 +0200
Subject: [PATCH 37/47] vma: use BlockBackend on extract
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/vma.c b/vma.c
-index c8ad6c0..a2ddd32 100644
+index f71e5a5..ad51090 100644
--- a/vma.c
+++ b/vma.c
-@@ -19,6 +19,7 @@
- #include "qemu/error-report.h"
+@@ -20,6 +20,7 @@
#include "qemu/main-loop.h"
+ #include "qapi/qmp/qstring.h"
#include "sysemu/char.h" /* qstring_from_str */
+#include "sysemu/block-backend.h"
static void help(void)
{
-@@ -263,6 +264,8 @@ static int extract_content(int argc, char **argv)
+@@ -264,6 +265,8 @@ static int extract_content(int argc, char **argv)
int vmstate_fd = -1;
guint8 vmstate_stream = 0;
for (i = 1; i < 255; i++) {
VmaDeviceInfo *di = vma_reader_get_device_info(vmar, i);
if (di && (strcmp(di->devname, "vmstate") == 0)) {
-@@ -307,8 +310,6 @@ static int extract_content(int argc, char **argv)
+@@ -308,8 +311,6 @@ static int extract_content(int argc, char **argv)
write_zero = false;
}
size_t devlen = strlen(devfn);
QDict *options = NULL;
if (format) {
-@@ -326,10 +327,14 @@ static int extract_content(int argc, char **argv)
+@@ -327,10 +328,14 @@ static int extract_content(int argc, char **argv)
qdict_put(options, "driver", qstring_from_str("raw"));
}
if (vma_reader_register_bs(vmar, i, bs, write_zero, &errp) < 0) {
g_error("%s", error_get_pretty(errp));
}
-@@ -362,6 +367,8 @@ static int extract_content(int argc, char **argv)
+@@ -363,6 +368,8 @@ static int extract_content(int argc, char **argv)
vma_reader_destroy(vmar);