Bug 1019474

Summary: RHEL-7 can't load piix4_pm migration section from RHEL-6.5
Product: Red Hat Enterprise Linux 7 Reporter: Eduardo Habkost <ehabkost>
Component: qemu-kvmAssignee: Eduardo Habkost <ehabkost>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: acathrow, alex.williamson, huding, juzhang, michen, mrezanin, mtosatti, qzhang, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-11.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:10:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 889670, 915399    

Description Eduardo Habkost 2013-10-15 19:46:59 UTC
Description of problem:
When using the scratch build containing the fix for bug 1016736, migratino aborts on the destination with:
Unknown savevm section type 115
load of migration failed


Version-Release number of selected component (if applicable):
Destination host: qemu-kvm-1.5.3-9.el7.x86_64
Source host: qemu-kvm-0.12.1.2-2.412.el6.max_version_id_v2.x86_64
  (from https://brewweb.devel.redhat.com/taskinfo?taskID=6415967 )

How reproducible:
Always.


Steps to Reproduce:
1. Source: /usr/libexec/qemu-kvm -m 1024 -drive file=/var/lib/libvirt/images/rhel64.qcow2,format=qcow2 -vnc :0 -vga cirrus -nodefaults -monitor stdio
2. Destination: /usr/libexec/qemu-kvm -m 1024 -drive file=/var/lib/libvirt/images/rhel64.qcow2,format=qcow2 -vnc :0 -vga cirrus -nodefaults -monitor stdio -incoming tcp:0.0.0.0:1234
3. Monitor on source: migrate tcp:destination-host:1234


Additional info:

Dump ofthe sections being loaded on destination, with help from gdb:

Breakpoint 4, vmstate_load (f=0x5555566ad760, se=0x55555668aad0, version_id=2) at /usr/src/debug/qemu-1.5.3/savevm.c:1756
1756    {
1: *se = {entry = {tqe_next = 0x5555566871b0, tqe_prev = 0x55555668ace0}, idstr = "fdc", '\000' <repeats 252 times>, instance_id = 0, alias_id = 1008, version_id = 2, section_id = 25, ops = 0x0, vmsd = 0x555555bce940 <vmstate_isa_fdc>, opaque = 0x55555668af10, compat = 0x0, no_migrate = 0, is_ram = 0}
$981 = {entry = {tqe_next = 0x5555566871b0, tqe_prev = 0x55555668ace0}, idstr = "fdc", '\000' <repeats 252 times>, instance_id = 0, alias_id = 1008, version_id = 2, section_id = 25, ops = 0x0, vmsd = 0x555555bce940 <vmstate_isa_fdc>, opaque = 0x55555668af10, compat = 0x0, no_migrate = 0, is_ram = 0}

Breakpoint 4, vmstate_load (f=0x5555566ad760, se=0x5555566970c0, version_id=2) at /usr/src/debug/qemu-1.5.3/savevm.c:1756
1756    {
1: *se = {entry = {tqe_next = 0x0, tqe_prev = 0x555556689ac0}, idstr = "0000:00:01.3/piix4_pm", '\000' <repeats 234 times>, instance_id = 0, alias_id = -1, version_id = 3, section_id = 28, ops = 0x0, vmsd = 0x555555b58ca0 <vmstate_acpi>, opaque = 0x555556688310, compat = 0x555556697230, no_migrate = 0, is_ram = 0}
$982 = {entry = {tqe_next = 0x0, tqe_prev = 0x555556689ac0}, idstr = "0000:00:01.3/piix4_pm", '\000' <repeats 234 times>, instance_id = 0, alias_id = -1, version_id = 3, section_id = 28, ops = 0x0, vmsd = 0x555555b58ca0 <vmstate_acpi>, opaque = 0x555556688310, compat = 0x555556697230, no_migrate = 0, is_ram = 0}
Unknown savevm section type 115
load of migration failed
[Thread 0x7fffebae6700 (LWP 29858) exited]
[Thread 0x7ffff7fcaa00 (LWP 29856) exited]
[Inferior 1 (process 29856) exited with code 01]
(gdb) 


The problem may be in the "piix4_pm" section, but I couldn't find any obvious issues from a quick look.

Comment 1 Eduardo Habkost 2013-10-15 19:54:05 UTC
(In reply to Eduardo Habkost from comment #0)
> Steps to Reproduce:
> 1. Source: /usr/libexec/qemu-kvm -m 1024 -drive
> file=/var/lib/libvirt/images/rhel64.qcow2,format=qcow2 -vnc :0 -vga cirrus
> -nodefaults -monitor stdio
> 2. Destination: /usr/libexec/qemu-kvm -m 1024 -drive
> file=/var/lib/libvirt/images/rhel64.qcow2,format=qcow2 -vnc :0 -vga cirrus
> -nodefaults -monitor stdio -incoming tcp:0.0.0.0:1234
> 3. Monitor on source: migrate tcp:destination-host:1234

Oops, I forgot to add the machine-type. But the bug can be reproduced when using "-machine rhel6.4.0" as well.

Comment 2 Eduardo Habkost 2013-10-15 20:33:43 UTC
From hw/acpi/piix4.c:

/* qemu-kvm 1.2 uses version 3 but advertised as 2
 * To support incoming qemu-kvm 1.2 migration, change version_id
 * and minimum_version_id to 2 below (which breaks migration from
 * qemu 1.2).
 *
 */
static const VMStateDescription vmstate_acpi = {
    .name = "piix4_pm",
    .version_id = 3,
    .minimum_version_id = 3,
    .minimum_version_id_old = 1,
    .load_state_old = acpi_load_old,


The v3 format of qemu-0.13 (implemented by commit 4cf3e6f3d85492f20a773dd6c9068ab89ba24a18) is not compatible with the v3 format of qemu-0.15 and newer (broken by commit 23910d3f669d46073b403876e30a7314599633af). RHEL-6 is using the v3 format that was included on qemu-0.13, which is not compatible with qemu 0.15 and newer (including qemu 1.2).

Probably setting minimum_version_id=2 will work.

Comment 5 Miroslav Rezanina 2013-10-31 07:56:06 UTC
Fix included in qemu-kvm-1.5.3-11.el7

Comment 9 Ludek Smid 2014-06-13 11:10:24 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.