Patchwork [4/4] savevm: use seekeble file to savevm

login
register
mail settings
Submitter Wayne Xia
Date Feb. 28, 2013, 8:09 a.m.
Message ID <1362038985-19008-5-git-send-email-xiawenc@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/223809/
State New
Headers show

Comments

Wayne Xia - Feb. 28, 2013, 8:09 a.m.
This patch can verify that it is compatiable with old stream
snapshot format.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
---
 savevm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/savevm.c b/savevm.c
index 57dbf09..8ab0a3d 100644
--- a/savevm.c
+++ b/savevm.c
@@ -425,8 +425,11 @@  static const QEMUFileOps bdrv_write_ops = {
 
 static QEMUFile *qemu_fopen_bdrv(BlockDriverState *bs, int is_writable)
 {
-    if (is_writable)
-        return qemu_fopen_ops(bs, &bdrv_write_ops);
+    if (is_writable) {
+        QEMUFile *qf = qemu_fopen_ops(bs, &bdrv_write_ops);
+        qf->file_seekable = true;
+        return qf;
+    }
     return qemu_fopen_ops(bs, &bdrv_read_ops);
 }