aboutsummaryrefslogtreecommitdiff
path: root/block/sheepdog.c
diff options
context:
space:
mode:
authorMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>2012-08-30 03:39:45 +0900
committerKevin Wolf <kwolf@redhat.com>2012-09-12 15:50:09 +0200
commit1f7a48de4467f31afc51169122453318efdb0f33 (patch)
tree45f60f149a066a5206c72698eb279e3aaa440a10 /block/sheepdog.c
parente0a1e32dbc41e6b2aabb436a9417dfd32177a3dc (diff)
downloadqemu-1f7a48de4467f31afc51169122453318efdb0f33.zip
qemu-1f7a48de4467f31afc51169122453318efdb0f33.tar.gz
qemu-1f7a48de4467f31afc51169122453318efdb0f33.tar.bz2
sheepdog: fix savevm and loadvm
This patch sets data to be sent to Sheepdog correctly and fixes savevm and loadvm operations on a Sheepdog image. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r--block/sheepdog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index df4f441..e0753ee 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1986,7 +1986,7 @@ static int do_load_save_vmstate(BDRVSheepdogState *s, uint8_t *data,
vdi_index = pos / SD_DATA_OBJ_SIZE;
offset = pos % SD_DATA_OBJ_SIZE;
- data_len = MIN(remaining, SD_DATA_OBJ_SIZE);
+ data_len = MIN(remaining, SD_DATA_OBJ_SIZE - offset);
vmstate_oid = vid_to_vmstate_oid(s->inode.vdi_id, vdi_index);
@@ -2007,6 +2007,7 @@ static int do_load_save_vmstate(BDRVSheepdogState *s, uint8_t *data,
}
pos += data_len;
+ data += data_len;
remaining -= data_len;
}
ret = size;