Skip to contentSkip to conversation

broken backward migration due to commit 461a275 "parallel: adding vmstate for save/restore"

Qemu-devel Igor Mammedov 2 participants 9 messages Dec 19, 2014

lore
Share & tools
lore
#0 lore raw

steps to reproduce:

Current master source:
qemu-system-x86_64 -monitor stdio -M pc-i440fx-2.1 (qemu) stop
(qemu) migrate "exec:gzip -c > STATEFILE.gz"

Target:
qemu-system-x86_64-2.1 -monitor stdio -M pc-i440fx-2.1 -incoming "exec: gzip -c -d STATEFILE.gz"

#1 lore raw
Quoted 10 lines · Igor Mammedov

steps to reproduce:

Current master source:
qemu-system-x86_64 -monitor stdio -M pc-i440fx-2.1 (qemu) stop
(qemu) migrate "exec:gzip -c > STATEFILE.gz"

Target:
qemu-system-x86_64-2.1 -monitor stdio -M pc-i440fx-2.1 -incoming "exec: gzip -c -d STATEFILE.gz"

That's expected. Backwards migration is not supported by upstream, and there's no equivalent of subsections for entire devices.

Just use "-parallel none".

Paolo

#2 lore raw
Quoted 10 lines · On Fri, 19 Dec 2014 12:15:20 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 7 lines · Igor Mammedov

steps to reproduce:

Current master source:
qemu-system-x86_64 -monitor stdio -M pc-i440fx-2.1 (qemu) stop
(qemu) migrate "exec:gzip -c > STATEFILE.gz"

Quoted 8 lines
Quoted 3 lines

Target:
qemu-system-x86_64-2.1 -monitor stdio -M pc-i440fx-2.1 -incoming "exec: gzip -c -d STATEFILE.gz"

That's expected. Backwards migration is not supported by upstream, and there's no equivalent of subsections for entire devices.

Just use "-parallel none".

ok

There is one more commit that breaks it, this time with subsection 6c3bff0 "exec: Save CPUState::exception_index field"

qemu: warning: error while loading state for instance 0x0 of device 'cpu_common' the same reproducer with -parallel none

Quoted 2 lines

Paolo

#3 lore raw
Quoted 20 lines · On Fri, 19 Dec 2014 12:32:52 +0100 Igor Mammedov <[email protected]> wrote:
Quoted 17 lines · On Fri, 19 Dec 2014 12:15:20 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 10 lines · Igor Mammedov

steps to reproduce:

Current master source:
qemu-system-x86_64 -monitor stdio -M pc-i440fx-2.1 (qemu) stop
(qemu) migrate "exec:gzip -c > STATEFILE.gz"

Target:
qemu-system-x86_64-2.1 -monitor stdio -M pc-i440fx-2.1 -incoming "exec: gzip -c -d STATEFILE.gz"

That's expected. Backwards migration is not supported by upstream, and there's no equivalent of subsections for entire devices.

Quoted 8 lines
Quoted 1 line

Just use "-parallel none".

ok

There is one more commit that breaks it, this time with subsection 6c3bff0 "exec: Save CPUState::exception_index field"

qemu: warning: error while loading state for instance 0x0 of device 'cpu_common' the same reproducer with -parallel none

correction this time it's with -M pc-i440fx-1.7 and target qemu-1.7

Quoted 5 lines
Quoted 3 lines

Paolo

#4 lore raw
In reply to Igor Mammedov
Quoted 5 lines · Igor Mammedov

There is one more commit that breaks it, this time with subsection 6c3bff0 "exec: Save CPUState::exception_index field"

qemu: warning: error while loading state for instance 0x0 of device 'cpu_common' the same reproducer with -parallel none

Patch sent, thanks.

Paolo

#5 lore raw
Quoted 6 lines · On Fri, 19 Dec 2014 13:02:24 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 3 lines · Igor Mammedov

There is one more commit that breaks it, this time with subsection 6c3bff0 "exec: Save CPUState::exception_index field"

Quoted 6 lines
Quoted 2 lines

qemu: warning: error while loading state for instance 0x0 of device 'cpu_common' the same reproducer with -parallel none

Patch sent, thanks.

Paolo

one more breakage:
a28fe7e pckbd: adding new fields to vmstate

source:
qemu-system-x86_64 -monitor stdio -M pc-i440fx-1.7 -parallel none xpsp3x86.qcow2

switch to text screen where you could select Safe Mode and stop/migrate at this point

target:
qemu-system-x86_64-1.7 -monitor stdio -M pc-i440fx-1.7 -incoming "exec: gzip -c -d STATEFILE.gz" xpsp3x86.qcow2

qemu: warning: error while loading state for instance 0x0 of device 'pckbd'

#6 lore raw
Quoted 16 lines · On Fri, 19 Dec 2014 13:42:37 +0100 Igor Mammedov <[email protected]> wrote:
Quoted 6 lines · On Fri, 19 Dec 2014 13:02:24 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 3 lines · Igor Mammedov

There is one more commit that breaks it, this time with subsection 6c3bff0 "exec: Save CPUState::exception_index field"

Quoted 6 lines
Quoted 2 lines

qemu: warning: error while loading state for instance 0x0 of device 'cpu_common' the same reproducer with -parallel none

Patch sent, thanks.

Paolo

Quoted 7 lines

one more breakage:
a28fe7e pckbd: adding new fields to vmstate

source:
qemu-system-x86_64 -monitor stdio -M pc-i440fx-1.7 -parallel none xpsp3x86.qcow2

switch to text screen where you could select Safe Mode and stop/migrate at this point

one more issue if you continue normal boot and wait till XP is booted and then migrate the target will error out with:

qemu: warning: error while loading state for instance 0x0 of device 'serial'

Quoted 6 lines

target:
qemu-system-x86_64-1.7 -monitor stdio -M pc-i440fx-1.7 -incoming "exec: gzip -c -d STATEFILE.gz" xpsp3x86.qcow2

qemu: warning: error while loading state for instance 0x0 of device 'pckbd'

#7 lore raw
Quoted 9 lines · Igor Mammedov
Quoted 4 lines

source:
qemu-system-x86_64 -monitor stdio -M pc-i440fx-1.7 -parallel none xpsp3x86.qcow2

switch to text screen where you could select Safe Mode and stop/migrate at this point

one more issue if you continue normal boot and wait till XP is booted and then migrate the target will error out with:

qemu: warning: error while loading state for instance 0x0 of device 'serial'

I cannot reproduce this.

Paolo

#8 lore raw
In reply to Igor Mammedov
Quoted 22 lines · Igor Mammedov
Quoted 6 lines · On Fri, 19 Dec 2014 13:02:24 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 3 lines · Igor Mammedov

There is one more commit that breaks it, this time with subsection 6c3bff0 "exec: Save CPUState::exception_index field"

Quoted 6 lines
Quoted 2 lines

qemu: warning: error while loading state for instance 0x0 of device 'cpu_common' the same reproducer with -parallel none

Patch sent, thanks.

Paolo

one more breakage:
a28fe7e pckbd: adding new fields to vmstate

source:
qemu-system-x86_64 -monitor stdio -M pc-i440fx-1.7 -parallel none xpsp3x86.qcow2

Quoted 6 lines

switch to text screen where you could select Safe Mode and stop/migrate at this point

target:
qemu-system-x86_64-1.7 -monitor stdio -M pc-i440fx-1.7 -incoming "exec: gzip -c -d STATEFILE.gz" xpsp3x86.qcow2

qemu: warning: error while loading state for instance 0x0 of device 'pckbd'

Looks like Windows (all versions) writes 0xDD and 0xDF to the outport port of the keyboard controller when it enables/disables the A20 line. There are two possibilities:

1) disable this if you care about backwards-migration

2) apply upstream a patch like this:

hw/input/pckbd.c +1 -1
index 2b0cd3d..cb4a8be 100644
@@ -373,7 +373,7 @@ static void kbd_reset(void *opaque)
 
 static uint8_t kbd_outport_default(KBDState *s)
 {
-    return KBD_OUT_RESET | KBD_OUT_A20
+    return (0xdf & ~KBD_OUT_OBF & ~KBD_OUT_MOUSE_OBF)
            | (s->status & KBD_STAT_OBF ? KBD_OUT_OBF : 0)
            | (s->status & KBD_STAT_MOUSE_OBF ? KBD_OUT_MOUSE_OBF : 0);
 }

3) do both, so upstream works better

Paolo