xen: Fix, no unplug of pt device by platform device.
PATCH 1/1 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.
--- hw/xen_platform.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
hw/xen_platform.c +6 -2
@@ -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 ); } }
Signature · 1 line
Anthony PERARD
Quoted 7 lines · Anthony PERARD
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" <[email protected]>Signed-off-by Anthony PERARD <[email protected]>
Zhang, does it this patch fix the problem for you?
Quoted 34 lines
hw/xen_platform.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)hw/xen_platform.c +6
-2@@ -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 ); } }Signature · 1 line
Anthony PERARD
Quoted 7 lines · Anthony PERARD
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" <[email protected]>Signed-off-by Anthony PERARD <[email protected]>
Zhang, does it this patch fix the problem for you?
Quoted 34 lines
hw/xen_platform.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)hw/xen_platform.c +6
-2@@ -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 ); } }Signature · 1 line
Anthony PERARD