]> git.proxmox.com Git - mirror_qemu.git/commit - include/hw/i386/pc.h
virtio-pci: fix migration for pci bus master
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 14 Oct 2014 16:40:06 +0000 (19:40 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 2 Nov 2014 10:03:03 +0000 (12:03 +0200)
commit68a27b208a2328653faa09bc7a13d7ef0e2710bb
treed981e7664865fd5cf030129776f853fec84cc5c2
parent4d5e17a53b12bf48953aa486d71bd1f5549c0dea
virtio-pci: fix migration for pci bus master

Current support for bus master (clearing OK bit) together with the need to
support guests which do not enable PCI bus mastering, leads to extra state in
VIRTIO_PCI_FLAG_BUS_MASTER_BUG bit, which isn't robust in case of cross-version
migration for the case when guests use the device before setting DRIVER_OK.

Rip out this code, and replace it:
-   Modern QEMU doesn't need VIRTIO_PCI_FLAG_BUS_MASTER_BUG
    so just drop it for latest machine type.
-   For compat machine types, set PCI_COMMAND if DRIVER_OK
    is set.

As this is needed for 2.1 for both pc and ppc, move PC_COMPAT macros from pc.h
to a new common header.

Cc: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
hw/i386/pc_piix.c
hw/i386/pc_q35.c
hw/ppc/spapr.c
hw/virtio/virtio-pci.c
hw/virtio/virtio-pci.h
include/hw/compat.h [new file with mode: 0644]
include/hw/i386/pc.h