From 7839ff593be03a7de3c6760e0b50c565ea751d36 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 4 Nov 2013 14:30:48 +0100 Subject: pc: get rid of builtin pvpanic for "-M pc-1.5" This causes two slight backwards-incompatibilities between "-M pc-1.5" and 1.5's "-M pc": (1) a fw_cfg file is removed with this patch. This is only a problem if migration stops the virtual machine exactly during fw_cfg enumeration. (2) after migration, a VM created without an explicit "-device pvpanic" will stop reporting panics to management. The first problem only occurs if migration is done at a very, very early point (and I'm not sure it can happen in practice for reasonable-size VMs, since it will likely take more time to send the RAM to destination, than it will take for BIOS to scan fw_cfg). The second problem only occurs if the guest panics _and_ has a guest driver _and_ management knows to look at the crash event, so it is mostly theoretical at this point in time. Thus keep the code simple, and pretend it was never broken. Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- hw/misc/pvpanic.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'hw/misc') diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 226e298..5377fee 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -112,11 +112,6 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp) isa_register_ioport(d, &s->io, s->ioport); } -void pvpanic_init(ISABus *bus) -{ - isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE); -} - #define PVPANIC_IOPORT_PROP "ioport" uint16_t pvpanic_port(void) -- cgit v1.1 From 8d07d6c46597a885eb38d99cc6fff399ce69cd21 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Tue, 12 Nov 2013 11:53:24 -0700 Subject: vfio-pci: Fix multifunction=on When an assigned device is initialized it copies the device config space into the emulated config space. Unfortunately multifunction is setup prior to the device initfn and gets clobbered. We need to restore it just like pci-assign does. Cc: qemu-stable@nongnu.org Signed-off-by: Alex Williamson Signed-off-by: Paolo Bonzini --- hw/misc/vfio.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hw/misc') diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index fe95e03..f7f8a19 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -3568,6 +3568,13 @@ static int vfio_initfn(PCIDevice *pdev) vdev->emulated_config_bits[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_MULTI_FUNCTION; + /* Restore or clear multifunction, this is always controlled by QEMU */ + if (vdev->pdev.cap_present & QEMU_PCI_CAP_MULTIFUNCTION) { + vdev->pdev.config[PCI_HEADER_TYPE] |= PCI_HEADER_TYPE_MULTI_FUNCTION; + } else { + vdev->pdev.config[PCI_HEADER_TYPE] &= ~PCI_HEADER_TYPE_MULTI_FUNCTION; + } + /* * Clear host resource mapping info. If we choose not to register a * BAR, such as might be the case with the option ROM, we can get -- cgit v1.1