aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony PERARD <anthony.perard@citrix.com>2012-10-03 13:45:24 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-10-03 13:45:24 +0000
commitbd4982a6c6f1b133aff38873bc3b580af15cd334 (patch)
tree2e5d44ee4e5e2ae2d66ea89ae39b6ab549879191
parente744c06fca438dc08271e626034e632a270c91c8 (diff)
xen: Fix, no unplug of pt device by platform device.
The Xen platform device will unplug any NICs if requested by the guest (PVonHVM) including a NIC that would have been passthrough. This patch makes sure that a passthrough device will not be unplug. Reported-by: "Zhang, Yang Z" <yang.z.zhang@intel.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-rw-r--r--hw/xen_platform.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/xen_platform.c b/hw/xen_platform.c
index 0d6c2ff8c3..956dbfeae4 100644
--- a/hw/xen_platform.c
+++ b/hw/xen_platform.c
@@ -85,8 +85,10 @@ static void log_writeb(PCIXenPlatformState *s, char val)
static void unplug_nic(PCIBus *b, PCIDevice *d, void *o)
{
+ /* We have to ignore passthrough devices */
if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
- PCI_CLASS_NETWORK_ETHERNET) {
+ PCI_CLASS_NETWORK_ETHERNET
+ && strcmp(d->name, "xen-pci-passthrough") != 0) {
qdev_free(&d->qdev);
}
}
@@ -98,8 +100,10 @@ static void pci_unplug_nics(PCIBus *bus)
static void unplug_disks(PCIBus *b, PCIDevice *d, void *o)
{
+ /* We have to ignore passthrough devices */
if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
- PCI_CLASS_STORAGE_IDE) {
+ PCI_CLASS_STORAGE_IDE
+ && strcmp(d->name, "xen-pci-passthrough") != 0) {
qdev_unplug(&(d->qdev), NULL);
}
}