qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 07/17] add pci-bridge-seat
Date: Fri, 26 Jun 2015 15:46:01 +0200	[thread overview]
Message-ID: <1435326248-24291-8-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1435326248-24291-1-git-send-email-mst@redhat.com>

From: Gerd Hoffmann <kraxel@redhat.com>

Simplifies multiseat configuration, see
docs/multiseat.txt update for details.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/pci/pci.h           |  1 +
 hw/pci-bridge/pci_bridge_dev.c | 25 ++++++++++++++++++++++++-
 docs/multiseat.txt             | 19 +++++++++++++++++++
 docs/specs/pci-ids.txt         |  1 +
 4 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index d44bc84..551cb3d 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -92,6 +92,7 @@
 #define PCI_DEVICE_ID_REDHAT_SDHCI       0x0007
 #define PCI_DEVICE_ID_REDHAT_PCIE_HOST   0x0008
 #define PCI_DEVICE_ID_REDHAT_PXB         0x0009
+#define PCI_DEVICE_ID_REDHAT_BRIDGE_SEAT 0x000a
 #define PCI_DEVICE_ID_REDHAT_QXL         0x0100
 
 #define FMT_PCIBUS                      PRIx64
diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
index 36f73e1..e966d2e 100644
--- a/hw/pci-bridge/pci_bridge_dev.c
+++ b/hw/pci-bridge/pci_bridge_dev.c
@@ -28,7 +28,8 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/hotplug.h"
 
-#define TYPE_PCI_BRIDGE_DEV "pci-bridge"
+#define TYPE_PCI_BRIDGE_DEV      "pci-bridge"
+#define TYPE_PCI_BRIDGE_SEAT_DEV "pci-bridge-seat"
 #define PCI_BRIDGE_DEV(obj) \
     OBJECT_CHECK(PCIBridgeDev, (obj), TYPE_PCI_BRIDGE_DEV)
 
@@ -170,9 +171,31 @@ static const TypeInfo pci_bridge_dev_info = {
     }
 };
 
+/*
+ * Multiseat bridge.  Same as the standard pci bridge, only with a
+ * different pci id, so we can match it easily in the guest for
+ * automagic multiseat configuration.  See docs/multiseat.txt for more.
+ */
+static void pci_bridge_dev_seat_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+    k->device_id = PCI_DEVICE_ID_REDHAT_BRIDGE_SEAT;
+    dc->desc = "Standard PCI Bridge (multiseat)";
+}
+
+static const TypeInfo pci_bridge_dev_seat_info = {
+    .name              = TYPE_PCI_BRIDGE_SEAT_DEV,
+    .parent            = TYPE_PCI_BRIDGE_DEV,
+    .instance_size     = sizeof(PCIBridgeDev),
+    .class_init        = pci_bridge_dev_seat_class_init,
+};
+
 static void pci_bridge_dev_register(void)
 {
     type_register_static(&pci_bridge_dev_info);
+    type_register_static(&pci_bridge_dev_seat_info);
 }
 
 type_init(pci_bridge_dev_register);
diff --git a/docs/multiseat.txt b/docs/multiseat.txt
index b963665..814496e 100644
--- a/docs/multiseat.txt
+++ b/docs/multiseat.txt
@@ -106,6 +106,25 @@ the devices attached to the seat.
 Background info is here:
   http://www.freedesktop.org/wiki/Software/systemd/multiseat/
 
+
+guest side with pci-bridge-seat
+-------------------------------
+
+Qemu version FIXME and newer has a new pci-bridge-seat device which
+can be used instead of pci-bridge.  Just swap the device name in the
+qemu command line above.  The only difference between the two devices
+is the pci id.  We can match the pci id instead of the device path
+with a nice generic rule now, which simplifies the guest
+configuration:
+
+    [root@fedora ~]# cat /etc/udev/rules.d/70-qemu-pci-bridge-seat.rules
+    SUBSYSTEM=="pci", ATTR{vendor}=="0x1b36", ATTR{device}=="0x000a", \
+            TAG+="seat", ENV{ID_AUTOSEAT}="1"
+
+Patch with this rule will be submitted to upstream udev/systemd, so
+long-term, when systemd with this lands in distros, things will work
+just fine without any manual guest configuration.
+
 Enjoy!
 
 --
diff --git a/docs/specs/pci-ids.txt b/docs/specs/pci-ids.txt
index e4a4490..0adcb89 100644
--- a/docs/specs/pci-ids.txt
+++ b/docs/specs/pci-ids.txt
@@ -47,6 +47,7 @@ PCI devices (other than virtio):
 1b36:0005  PCI test device (docs/specs/pci-testdev.txt)
 1b36:0006  PCI Rocker Ethernet switch device
 1b36:0007  PCI SD Card Host Controller Interface (SDHCI)
+1b36:000a  PCI-PCI bridge (multiseat)
 
 All these devices are documented in docs/specs.
 
-- 
MST

  parent reply	other threads:[~2015-06-26 13:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 13:45 [Qemu-devel] [PULL 00/17] virtio, pci fixes, enhancements Michael S. Tsirkin
2015-06-26 13:45 ` [Qemu-devel] [PULL 01/17] virito-pci: fix OVERRUN problem Michael S. Tsirkin
2015-06-26 13:45 ` [Qemu-devel] [PULL 02/17] qdev: fix OVERFLOW_BEFORE_WIDEN Michael S. Tsirkin
2015-06-26 13:45 ` [Qemu-devel] [PULL 03/17] balloon: add a feature bit to let Guest OS deflate balloon on oom Michael S. Tsirkin
2015-06-26 13:45 ` [Qemu-devel] [PULL 04/17] vhost: correctly pass error to caller in vhost_dev_enable_notifiers() Michael S. Tsirkin
2015-06-26 13:45 ` [Qemu-devel] [PULL 05/17] MAINTAINERS: add ACPI entry Michael S. Tsirkin
2015-06-26 13:45 ` [Qemu-devel] [PULL 06/17] pc: cleanup and convert TMP ACPI device description to AML API Michael S. Tsirkin
2015-06-26 13:46 ` Michael S. Tsirkin [this message]
2015-06-26 13:46 ` [Qemu-devel] [PULL 08/17] migration: introduce VMSTATE_BUFFER_UNSAFE_INFO_TEST() Michael S. Tsirkin
2015-06-26 13:46 ` [Qemu-devel] [PULL 09/17] hw/pci-bridge: expose _test parameter in SHPC_VMSTATE() Michael S. Tsirkin
2015-06-26 13:46 ` [Qemu-devel] [PULL 10/17] hw/pci-bridge: add macro for "chassis_nr" property Michael S. Tsirkin
2015-06-26 13:46 ` [Qemu-devel] [PULL 11/17] hw/pci-bridge: add macro for "msi" property Michael S. Tsirkin
2015-06-26 13:46 ` [Qemu-devel] [PULL 12/17] hw/pci: introduce shpc_present() helper function Michael S. Tsirkin
2015-06-26 13:46 ` [Qemu-devel] [PULL 13/17] hw/pci-bridge: introduce "shpc" property Michael S. Tsirkin
2015-06-26 13:46 ` [Qemu-devel] [PULL 14/17] hw/pci-bridge: disable SHPC in PXB Michael S. Tsirkin
2015-06-26 13:46 ` [Qemu-devel] [PULL 15/17] hw/core: explicit OFW unit address callback for SysBusDeviceClass Michael S. Tsirkin
2015-06-26 13:46 ` [Qemu-devel] [PULL 16/17] hw/pci-bridge: format special OFW unit address for PXB host Michael S. Tsirkin
2015-06-26 14:28   ` Laszlo Ersek
2015-06-26 15:46     ` Marcel Apfelbaum
2015-06-26 13:46 ` [Qemu-devel] [PULL 17/17] Fix glib_subprocess test Michael S. Tsirkin
2015-06-29  9:30 ` [Qemu-devel] [PULL 00/17] virtio, pci fixes, enhancements Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435326248-24291-8-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).