virtio-serial-bus: post_load send_event when vm is running
commit80dcfb8532ae76343109a48f12ba8ca1c505c179
authorAlon Levy <alevy@redhat.com>
Wed, 14 Nov 2012 13:09:07 +0000 (14 15:09 +0200)
committerAmit Shah <amit.shah@redhat.com>
Fri, 16 Nov 2012 08:40:37 +0000 (16 14:10 +0530)
treea2cc2fdb3bfd4f1654ad781fcafcd1013fd7c2db
parentce34cf72fe508b27a78f83c184142e8d1e6a048a
virtio-serial-bus: post_load send_event when vm is running

Alexander Larsson found irq injection to Windows guests stopped after a
migration.  The symptom was the mouse stopped working.

Reproduction steps are:
1. On src, start qemu with a virtio-serial port without any backend
2. On dest, start qemu with a virtio-serial port with a backend
3. Migrate.

Upon migration, the older code detected the change in backend connection
status, and sent a notification to the guest.  However, it's not
guaranteed that the apic is ready to inject irqs into the guest, and the
irq line remained high, resulting in any future interrupts going
unnoticed by the guest as well.

Add a new timer based on vm_clock for 1 ns in the future from post_load
to do the event send in case host_connected differs between migration
source and target.

RHBZ: 867366

Signed-off-by: Alon Levy <alevy@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com> # verbose commit log
hw/virtio-serial-bus.c