qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v1] s390x/pci: Warn when adding PCI devices without the 'zpci' feature
@ 2019-01-22  9:41 David Hildenbrand
  2019-01-22  9:50 ` Thomas Huth
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: David Hildenbrand @ 2019-01-22  9:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-s390x, Collin Walling, Thomas Huth, Christian Borntraeger,
	Cornelia Huck, Richard Henderson, David Hildenbrand

We decided to always create the PCI host bridge, even if 'zpci' is not
enabled (due to migration compatibility). This however right now allows
to add zPCI/PCI devices to a VM although the guest will never actually see
them, confusing people that are using a simple CPU model that has no
'zpci' enabled - "Why isn't this working" (David Hildenbrand)

Let's check for 'zpci' and at least print a warning that this will not
work as expected. We could also bail out, however that might break
existing QEMU commandlines.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 hw/s390x/s390-pci-bus.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index b86a8bdcd4..e7d4f49611 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -863,6 +863,11 @@ static void s390_pcihost_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
 {
     S390pciState *s = S390_PCI_HOST_BRIDGE(hotplug_dev);
 
+    if (!s390_has_feat(S390_FEAT_ZPCI)) {
+        warn_report("Adding PCI or zPCI devices without the 'zpci' CPU feature."
+                    " The guest will not be able to see/use these devices.");
+    }
+
     if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
         PCIDevice *pdev = PCI_DEVICE(dev);
 
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-02-04 13:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-22  9:41 [Qemu-devel] [PATCH v1] s390x/pci: Warn when adding PCI devices without the 'zpci' feature David Hildenbrand
2019-01-22  9:50 ` Thomas Huth
2019-01-22 10:06   ` David Hildenbrand
2019-01-22 13:13     ` Cornelia Huck
2019-01-22 13:20       ` David Hildenbrand
2019-01-22 13:23         ` Cornelia Huck
2019-01-22 13:25           ` David Hildenbrand
2019-01-22 13:30             ` Cornelia Huck
2019-01-22 12:44 ` Cornelia Huck
2019-01-22 12:52   ` David Hildenbrand
2019-01-22 15:03     ` Christian Borntraeger
2019-01-22 15:11       ` David Hildenbrand
2019-01-24 14:56         ` Thomas Huth
2019-02-04 13:31         ` [Qemu-devel] [qemu-s390x] " Christian Borntraeger
2019-01-28 11:24 ` [Qemu-devel] " Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).