Skip to contentSkip to conversation

virtconsole migration regression from 2.2.0

Qemu-devel Cole Robinson 2 participants 2 messages Mar 24, 2015 – Mar 25, 2015

lore
Share & tools
lore
#0 lore raw

I'm hitting an error migrating from stock v2.2.0 to git master:

2015-03-24T21:42:07.731317Z qemu-system-x86_64: error while loading state for
instance 0x0 of device '0000:00:05.0/virtio-console'
2015-03-24T21:42:07.731392Z qemu-system-x86_64: load of migration failed:

Invalid argument

I'm using libvirt's managedsave, which is migrate to/from file. I bisected to this commit:

commit 9b70c1790acacae54d559d38ca69186a85040bb8

Author: Michael S. Tsirkin <[email protected]>
Date:   Mon Feb 16 22:36:26 2015 +0100

virtio-serial: switch to standard-headers

Problem seems to be that the old virtio_console_config structure was different, missing the emerg_wr field. If I apply this patch:

(quoted diff) +0 -0

b/include/standard-headers/linux/virtio_console.h
index 0dedc9e..242a0c5 100644

include/standard-headers/linux/virtio_console.h +0 -2
@@ -50,8 +50,6 @@ struct virtio_console_config {
        uint16_t rows;
        /* max. number of ports this device can hold */
        uint32_t max_nr_ports;
-       /* emergency write register */
-       uint32_t emerg_wr;
 } QEMU_PACKED;
 
 

My VMs restore correctly. I assume that change isn't acceptable as-is though...

Here's the massive libvirt command line:

/home/crobinso/src/qemu/x86_64-softmmu/qemu-system-x86_64 -name
migrateion-tester.py-vm -S -machine pc-i440fx-2.2,accel=kvm,usb=off -cpu Opteron_G4,+nodeid_msr,+wdt,+skinit,+ibs,+osvw,+cr8legacy,+extapic,+cmp_legacy,+fxsr_opt,+mmxext,+osxsave,+monitor,+ht,+vme -m 2048 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid ce2a1280-78e5-7233-3f67-139dfedfdfe9 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/migrateion-tester.py-vm.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
-boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/mnt/data/devel/images/ztester-f18-migrate-overlay.qcow2,if=none,id=drive-virtio-disk0,format=qcow2 -device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-netdev tap,fd=27,id=hostnet0,vhost=on,vhostfd=28 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:40:ee:0b,bus=pci.0,addr=0x3 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -chardev pty,id=charconsole0 -device
virtconsole,chardev=charconsole0,id=console0 -device usb-tablet,id=input0
-spice port=5901,tls-port=5902,addr=127.0.0.1,disable-ticketing,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on -device
qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2
-device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device
hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -incoming fd:24 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -snapshot -msg timestamp=on

I tried to reduce it to a minimal reproducer but I couldn't trigger it, but I didn't try too long. I can test any proposed fix though.

Thanks,
Cole

#1 lore raw
Quoted 33 lines · Cole Robinson

I'm hitting an error migrating from stock v2.2.0 to git master:

2015-03-24T21:42:07.731317Z qemu-system-x86_64: error while loading state for
instance 0x0 of device '0000:00:05.0/virtio-console'
2015-03-24T21:42:07.731392Z qemu-system-x86_64: load of migration failed:

Invalid argument

I'm using libvirt's managedsave, which is migrate to/from file. I bisected to this commit:

commit 9b70c1790acacae54d559d38ca69186a85040bb8

Author: Michael S. Tsirkin <[email protected]>
Date:   Mon Feb 16 22:36:26 2015 +0100

virtio-serial: switch to standard-headers

Problem seems to be that the old virtio_console_config structure was different, missing the emerg_wr field. If I apply this patch:

include/standard-headers/linux/virtio_console.h +0 -2
index 0dedc9e..242a0c5 100644
@@ -50,8 +50,6 @@ struct virtio_console_config {
        uint16_t rows;
        /* max. number of ports this device can hold */
        uint32_t max_nr_ports;
-       /* emergency write register */
-       uint32_t emerg_wr;
 } QEMU_PACKED;
 
 
Quoted 1 line

My VMs restore correctly. I assume that change isn't acceptable as-is though...

Thanks! I see the problem, will fix it shortly.

Quoted 34 lines

Here's the massive libvirt command line:

/home/crobinso/src/qemu/x86_64-softmmu/qemu-system-x86_64 -name
migrateion-tester.py-vm -S -machine pc-i440fx-2.2,accel=kvm,usb=off -cpu Opteron_G4,+nodeid_msr,+wdt,+skinit,+ibs,+osvw,+cr8legacy,+extapic,+cmp_legacy,+fxsr_opt,+mmxext,+osxsave,+monitor,+ht,+vme -m 2048 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid ce2a1280-78e5-7233-3f67-139dfedfdfe9 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/migrateion-tester.py-vm.monitor,server,nowait

include/standard-headers/linux/virtio_console.h +0 -2
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
-boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device

virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/mnt/data/devel/images/ztester-f18-migrate-overlay.qcow2,if=none,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=27,id=hostnet0,vhost=on,vhostfd=28 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:40:ee:0b,bus=pci.0,addr=0x3 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -chardev pty,id=charconsole0 -device
virtconsole,chardev=charconsole0,id=console0 -device usb-tablet,id=input0
-spice port=5901,tls-port=5902,addr=127.0.0.1,disable-ticketing,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -incoming fd:24 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -snapshot -msg timestamp=on

I tried to reduce it to a minimal reproducer but I couldn't trigger it, but I didn't try too long. I can test any proposed fix though.

Thanks,
Cole