qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Bug in virtio_net_load
@ 2016-06-30  8:34 Robin Geuze
  2016-06-30 17:23 ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Robin Geuze @ 2016-06-30  8:34 UTC (permalink / raw)
  To: mst, jasowang, qemu-devel; +Cc: dgilbert

Hey,

I work for TransIP and we host a VPS platform based on QEMU/KVM. We are 
currently running qemu 2.4.0. A few days ago we noticed that live 
migrations for some of our VM's would fail. Further investigation turned 
out it was specific to windows server 2012, caused by the fact that the 
standard virtio driver from RedHat was replaced in windows updates by a 
driver called "Midfin eFabric" (this driver doesn't really seem to be 
meant for virtio, we have a case running at MicroSoft about that).  Once 
we knew how to reproduce we tested this on  QEMU 2.6.0 as well and it 
also seems to be affected (later we found out that 2.4.0 to 2.6.0 
migration does work probably due to pure luck).

We started investigating the problem in QEMU 2.4.0 and noticed it was 
caused by the fact that virtio_net_device_load requires certain feature 
flags to be set, specifically to load curr_guest_offloads which is only 
written and read if the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS flag is set, 
but those flags are set in virtio_load after the call to 
virtio_net_device_load. Moving the code setting the feature flags before 
the call to virtio_net_device_load fixes it, however it introduces 
another problem. Virtio can have 64-bits feature flags, however the 
standard save payload for virtio only has space for 32-bits feature 
flags. This was solved by putting those in a subsection of the 
vmstate_save_state stuff. Unfortunately this is called (and thus binary 
offset located) after the virtio_net_device_load code.

There was an attempt to fix this in QEMU 2.6.0. However, this seems to 
have broken it worse. The write code (virtio_net_save, virtio_save and 
virtio_net_save_device) still puts the curr_guest_offloads value before 
the vmstate_save_state data. However the read code expects and tries to 
read it after the vmstate_save_state data. Should we just also change 
the virtio_net_save code to have it follow the same order as 
virtio_net_load? Or will this potentially break more stuff.

Regards,

Robin Geuze

TransIP BV

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

end of thread, other threads:[~2016-07-04 19:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-30  8:34 [Qemu-devel] Bug in virtio_net_load Robin Geuze
2016-06-30 17:23 ` Michael S. Tsirkin
2016-06-30 17:29   ` Dr. David Alan Gilbert
2016-07-01  2:35   ` Jason Wang
2016-07-01  8:48   ` Cornelia Huck
2016-07-01  8:54     ` Robin Geuze
2016-07-04  7:11     ` Robin Geuze

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).