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

Submitted by Wayne Xia on Feb. 28, 2013, 8:09 a.m.

Details

Message ID 1362038985-19008-5-git-send-email-xiawenc@linux.vnet.ibm.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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);
 }