[sheepdog] savevm snapshot hang (qemu 0.12-rc1 + sheepdog git)

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Aug 29 19:50:39 CEST 2012


At Wed, 29 Aug 2012 14:59:42 +0200 (CEST),
Alexandre DERUMIER wrote:
> 
> Hi,
> I'm trying to take live snapshots with qemu savevm monitor command, (qemu 0.12-rc1 + sheepdog git),
> vm is hanging and the snasphot is not take.
> 
> Is it broken for now ?

I found a trivial bug in the qemu block driver code.  Can you try the
following diff against QEMU?

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;



More information about the sheepdog mailing list