Skip to contentSkip to conversation

save/restore broken?

Qemu-devel Paolo Bonzini 5 participants 6 messages Aug 11, 2009 – Aug 13, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

if I try to save and restore an image using current qemu and current libvirt, the load fails. Comparing a preexisting save file and the new save file generated by QEMU master, I get differences in an ide block like this (cmp output):

67500802 0 20

67500803  20   0
67500808   0   1
67500809   1   0

67500812 0 10
67500813 10 47
67500814 47 374
67500815 374 232
67500816 232 0
67500821 0 360
67500822 360 120
67500823 120 0
67500828 0 20
67500830 20 0

67500832   0   1
67500833   0 300
67500834   1 205

67500835 300 0
67500836 205 0

The IDE section starts at 67499922 (this is where the 0x00000004 signature is, so the error is 880 bytes inside the IDE block including the section headers).

I could not pinpoint any obvious culprit in the log. Hope this helps.

Paolo

#1 lore raw
Quoted 4 lines · On Tue, 11 Aug 2009 18:39:47 +0200 Paolo Bonzini <[email protected]> wrote:

Hi all,

if I try to save and restore an image using current qemu and current libvirt, the load fails.

Yes, it's broken. I'm unable to loadvm and to migrate.

According to git bisect the problem was introduced by:

"""
commit 93c8cfd9e67a62711b86f4c93747566885eb7928

Author: Gleb Natapov <[email protected]>
Date:   Sun Aug 2 11:36:47 2009 +0300

make windows notice media change
"""

Indeed, reverting this fixes it for me.

When I try to loadvm I get this error:

"""
Unknown savevm section type 255
Error -22 while loading VM state
"""

The migration symptoms are different. Sometimes it
prints the same message, sometimes it kind of works but gets strange behaviors.

#2 lore raw
Quoted 4 lines · Luiz Capitulino

On Tue, 11 Aug 2009 18:39:47 +0200
Paolo Bonzini <[email protected]> wrote:

Quoted 8 lines
Quoted 4 lines

Hi all,

if I try to save and restore an image using current qemu and current libvirt, the load fails.

Yes, it's broken. I'm unable to loadvm and to migrate.

According to git bisect the problem was introduced by:

This should fix it.

Regards,

Anthony Liguori

commit a536948b3805a311f274b119c5202fdc86504cf3

Author: Anthony Liguori <[email protected]>
Date:   Thu Aug 13 13:58:21 2009 -0500

Fix migration for ide devices

commit 93c8cfd9e67a62711b86f4c93747566885eb7928
Author: Gleb Natapov <[email protected]>
Date: Sun Aug 2 11:36:47 2009 +0300

make windows notice media change

Broke save/restore by loading a new field but not saving it.

hw/ide.c +1 -0
index bebda7c..1e38ae3 100644
@@ -2888,6 +2888,7 @@ static void ide_save(QEMUFile* f, IDEState *s)
 
     qemu_put_8s(f, &s->sense_key);
     qemu_put_8s(f, &s->asc);
+    qemu_put_8s(f, &s->cdrom_changed);
     /* XXX: if a transfer is pending, we do not save it yet */
 }
 
#5 lore raw
In reply to Luiz Capitulino
Quoted 24 lines · Luiz Capitulino
Quoted 4 lines · On Tue, 11 Aug 2009 18:39:47 +0200 Paolo Bonzini <[email protected]> wrote:

Hi all,

if I try to save and restore an image using current qemu and current libvirt, the load fails.

Yes, it's broken. I'm unable to loadvm and to migrate.

According to git bisect the problem was introduced by:

"""
commit 93c8cfd9e67a62711b86f4c93747566885eb7928

Author: Gleb Natapov <[email protected]>
Date:   Sun Aug 2 11:36:47 2009 +0300

make windows notice media change
"""

Indeed, reverting this fixes it for me.

When I try to loadvm I get this error:

Quoted 8 lines

"""
Unknown savevm section type 255
Error -22 while loading VM state
"""

The migration symptoms are different. Sometimes it
prints the same message, sometimes it kind of works but gets strange behaviors.

This patch fixes it for me, could you take a look if it also fixes things for you?

Thanks.

Quoted 1 line

From 1322dfad92766a402c341071b0d55be6e510ebb1 Mon Sep 17 00:00:00 2001

From: Juan Quintela <[email protected]>
Date: Thu, 13 Aug 2009 21:07:05 +0200
Subject: [PATCH] Fix migration, if we read a field, it is better if we wrote it first

---
 hw/ide.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/ide.c +1 -0
index bebda7c..1e38ae3 100644
@@ -2888,6 +2888,7 @@ static void ide_save(QEMUFile* f, IDEState *s)
 
     qemu_put_8s(f, &s->sense_key);
     qemu_put_8s(f, &s->asc);
+    qemu_put_8s(f, &s->cdrom_changed);
     /* XXX: if a transfer is pending, we do not save it yet */
 }
 
Signature · 1 line
1.6.2.5
#3 lore raw
In reply to Anthony Liguori
Quoted 39 lines · Anthony Liguori
Quoted 11 lines · Luiz Capitulino
Quoted 4 lines · On Tue, 11 Aug 2009 18:39:47 +0200 Paolo Bonzini <[email protected]> wrote:

Hi all,

if I try to save and restore an image using current qemu and current libvirt, the load fails.

Yes, it's broken. I'm unable to loadvm and to migrate.

According to git bisect the problem was introduced by:

This should fix it.

Regards,

Anthony Liguori

commit a536948b3805a311f274b119c5202fdc86504cf3

Author: Anthony Liguori <[email protected]>
Date:   Thu Aug 13 13:58:21 2009 -0500

Fix migration for ide devices

commit 93c8cfd9e67a62711b86f4c93747566885eb7928
Author: Gleb Natapov <[email protected]>
Date: Sun Aug 2 11:36:47 2009 +0300

make windows notice media change

Broke save/restore by loading a new field but not saving it.

hw/ide.c +0 -0
index bebda7c..1e38ae3 100644

hw/ide.c static void ide_save(QEMUFile* f, IDEState *s) · line 2894

Quoted 7 lines
hw/ide.c +1 -0
@@ -2888,6 +2888,7 @@ static void ide_save(QEMUFile* f, IDEState *s)
 
     qemu_put_8s(f, &s->sense_key);
     qemu_put_8s(f, &s->asc);
+    qemu_put_8s(f, &s->cdrom_changed);
     /* XXX: if a transfer is pending, we do not save it yet */
 }
 

Yap. Got lost between v3 and v4 of the patch :(

--
Gleb.

Tested-by
#4 lore raw
In reply to Anthony Liguori
Quoted 7 lines · On Thu, 13 Aug 2009 13:59:52 -0500 Anthony Liguori <[email protected]>…
Quoted 6 lines · Luiz Capitulino
Quoted 2 lines · On Tue, 11 Aug 2009 18:39:47 +0200 Paolo Bonzini <[email protected]> wrote:

Hi all,

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

if I try to save and restore an image using current qemu and current libvirt, the load fails.

Yes, it's broken. I'm unable to loadvm and to migrate.

According to git bisect the problem was introduced by:

This should fix it.

Yes it does, thanks Anthony.