[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 7/9] s390x: add have_virtio_ccw
From: |
Gerd Hoffmann |
Subject: |
[PULL 7/9] s390x: add have_virtio_ccw |
Date: |
Fri, 26 Mar 2021 13:49:30 +0100 |
Introduce a symbol which can be used to prevent ccw modules
being loaded into system emulators without ccw support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Tested-by: Halil Pasic <pasic@linux.ibm.com>
Message-Id: <20210317095622.2839895-3-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/s390x/virtio-ccw.h | 5 +++++
hw/s390x/virtio-ccw.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index 49a2b8ca42df..0168232e3b8d 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -63,6 +63,11 @@ typedef struct VirtioBusClass VirtioCcwBusClass;
DECLARE_OBJ_CHECKERS(VirtioCcwBusState, VirtioCcwBusClass,
VIRTIO_CCW_BUS, TYPE_VIRTIO_CCW_BUS)
+/*
+ * modules can reference this symbol to avoid being loaded
+ * into system emulators without ccw support
+ */
+extern bool have_virtio_ccw;
struct VirtIOCCWDeviceClass {
CCWDeviceClass parent_class;
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 06c06056814b..314ed7b24566 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -35,6 +35,8 @@
#define NR_CLASSIC_INDICATOR_BITS 64
+bool have_virtio_ccw = true;
+
static int virtio_ccw_dev_post_load(void *opaque, int version_id)
{
VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(opaque);
--
2.30.2
- [PULL 0/9] Fixes 20210326 patches, Gerd Hoffmann, 2021/03/26
- [PULL 1/9] usb: Remove "-usbdevice ccid", Gerd Hoffmann, 2021/03/26
- [PULL 3/9] vhost-user-gpu: fix vugbm_device_init fallback, Gerd Hoffmann, 2021/03/26
- [PULL 2/9] vhost-user-gpu: glFlush before notifying clients, Gerd Hoffmann, 2021/03/26
- [PULL 6/9] s390x: move S390_ADAPTER_SUPPRESSIBLE, Gerd Hoffmann, 2021/03/26
- [PULL 4/9] vhost-user-gpu: fix cursor move/update, Gerd Hoffmann, 2021/03/26
- [PULL 5/9] hw/usb/hcd-ehci-sysbus: Free USBPacket on instance finalize(), Gerd Hoffmann, 2021/03/26
- [PULL 7/9] s390x: add have_virtio_ccw,
Gerd Hoffmann <=
- [PULL 8/9] s390x: modularize virtio-gpu-ccw, Gerd Hoffmann, 2021/03/26
- [PULL 9/9] hw/usb/hcd-ehci: Fix crash when showing help of EHCI devices, Gerd Hoffmann, 2021/03/26
- Re: [PULL 0/9] Fixes 20210326 patches, Peter Maydell, 2021/03/26