qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Live migrate, inconsistent machine types - new machine type to fix?
@ 2014-07-18 23:33 Alex Bligh
  2014-07-19  5:51 ` Paolo Bonzini
  0 siblings, 1 reply; 28+ messages in thread
From: Alex Bligh @ 2014-07-18 23:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bligh

I'm trying to migrate between a pc-1.0 machine on qemu 1.0 and a pc-1.0 machine on qemu-2.0. This appears not to work.

It looks to me as if at some point along the line the definition of pc-1.0 has changed (eek).

The machine was booted with the command line [1] below, then migrated (for the sake of ease including a full block device dump) to a file. I'm happy to provide this (it's a blank cirros image but on a 20GB disk so quite large).

Restoring the machine with the command line [2] (merely adding -machine pc-1.0 which is not the default for qemu-2.0) produces the error:
Length mismatch: vga.vram: 1000000 in != 800000
qemu: warning: error while loading state for instance 0x0 of device 'ram'
load of migration failed

This can be fixed using command line [3] (adding an additional -global cirrus-vga.vgamem_mb=10) in which case it gets a little further.
Length mismatch: 0000:00:03.0/virtio-net-pci.rom: 10000 in != 20000
qemu: warning: error while loading state for instance 0x0 of device 'ram'
load of migration failed

I don't know how to get around that on the command line.

This Ubuntu bug:
   https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1291321

suggests that the root cause is a change in the definition of pc-1.0 between qemu 1.0 and 1.7. That's annoying, but obviously we can't change the definition of pc-1.0 now because users of later versions of qemu may be using the (newer) pc-1.0.

Assuming I can't find this on the command line (which I would be ok with I suppose), I propose to define a new machine type (e.g. pc-1.0-qemu-1.0) which would look like the original qemu 1.0 pc-1.0 machine type. I think I can see how to do this for the video ram, but I'm puzzled about how to do this for the virtio-net-pci.rom (and indeed anything else that I might come across).

Is this a profitable route of investigation, or should I just give up now and assume live migration between 1.0 and 2.0 is impossible?

-- 
Alex Bligh



[1] Use to start the VM on qemu 1.0

/usr/bin/kvm -name vm -uuid 33372d76-6d65-6e74-3132-333435363738 -m 512 -smp 1,cores=1,threads=1,sockets=1 -vga cirrus -usbdevice tablet -k en-gb -vnc 0.0.0.0:6313,password -monitor telnet:127.0.0.1:12345,server,nowait -drive file=/storage/img.qcow2,if=virtio,index=0,format=qcow2,media=disk,cache=writeback -boot order=cd -net nic,macaddr=00:16:3e:28:04:51,model=virtio,vlan=0 -net tap,ifname=tap13.0,script=no,downscript=no,vlan=0 -qmp unix:/var/run/vm.monitor,server,nowait -pidfile /var/run/vm.pid

HMP then used to save the device out with migrate -b.

[2] First attempt to start the VM on qemu 2.0 - just add -machine pc-1.0

/usr/bin/kvm -name testimport -machine pc-1.0 -uuid 33372d76-6d65-6e74-3132-333435363738 -m 512 -smp 1,cores=1,threads=1,sockets=1 -vga cirrus -usbdevice tablet -k en-gb -vnc 0.0.0.0:6314,password -monitor telnet:127.0.0.1:12345,server,nowait -drive file=/storage/img2.qcow2,if=virtio,index=0,format=qcow2,media=disk,cache=writeback -boot order=cd -net nic,macaddr=00:16:3e:28:04:51,model=virtio,vlan=0 -net socket,mcast=230.0.0.1:1234,vlan=0 -qmp unix:/var/run/testimport.monitor,server,nowait -pidfile /var/run/testimport.pid -incoming fd:</storage/vm.out

Result:

Length mismatch: vga.vram: 1000000 in != 800000
qemu: warning: error while loading state for instance 0x0 of device 'ram'
load of migration failed

[3] Second attempt to start the VM on qemu 2.0 - also add -global cirrus-vga.vgamem_mb=10

/usr/bin/kvm -name testimport -machine pc-1.0 -global cirrus-vga.vgamem_mb=10 -uuid 33372d76-6d65-6e74-3132-333435363738 -m 512 -smp 1,cores=1,threads=1,sockets=1 -vga cirrus -usbdevice tablet -k en-gb -vnc 0.0.0.0:6314,password -monitor telnet:127.0.0.1:12345,server,nowait -drive file=/storage/img2.qcow2,if=virtio,index=0,format=qcow2,media=disk,cache=writeback -boot order=cd -net nic,macaddr=00:16:3e:28:04:51,model=virtio,vlan=0 -net socket,mcast=230.0.0.1:1234,vlan=0 -qmp unix:/var/run/testimport.monitor,server,nowait -pidfile /var/run/testimport.pid -incoming fd:</storage/vm.out

Result:

Length mismatch: 0000:00:03.0/virtio-net-pci.rom: 10000 in != 20000
qemu: warning: error while loading state for instance 0x0 of device 'ram'
load of migration failed

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2014-07-22 12:48 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18 23:33 [Qemu-devel] Live migrate, inconsistent machine types - new machine type to fix? Alex Bligh
2014-07-19  5:51 ` Paolo Bonzini
2014-07-19  7:10   ` Alex Bligh
2014-07-19  7:30     ` Paolo Bonzini
2014-07-19  8:43       ` Alex Bligh
2014-07-19  8:54         ` Peter Maydell
2014-07-19  8:59           ` Alex Bligh
2014-07-19 10:53         ` Paolo Bonzini
2014-07-19 11:37           ` Alex Bligh
2014-07-21 10:22             ` Paolo Bonzini
2014-07-21 13:59               ` Alex Bligh
2014-07-21 14:11                 ` Paolo Bonzini
2014-07-21 14:35                   ` Alex Bligh
2014-07-21 14:14                 ` Paolo Bonzini
2014-07-22  7:11             ` Amit Shah
2014-07-22  9:50               ` Amit Shah
2014-07-22  9:55                 ` Paolo Bonzini
2014-07-22 10:22                   ` Amit Shah
2014-07-22 10:32                     ` Alex Bligh
2014-07-22 10:54                       ` Amit Shah
2014-07-22 11:38                         ` Alex Bligh
2014-07-22 11:54                           ` Amit Shah
2014-07-22 12:12                             ` Paolo Bonzini
2014-07-22 12:19                               ` Alex Bligh
2014-07-22 12:47                                 ` Amit Shah
2014-07-22 12:40                               ` Amit Shah
2014-07-22 12:15                             ` Alex Bligh
2014-07-22 12:44                               ` Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).