s390x: add have_virtio_ccw
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 17 Mar 2021 09:56:21 +0000 (10:56 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 26 Mar 2021 08:33:50 +0000 (09:33 +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.c
hw/s390x/virtio-ccw.h

index 06c06056814b23c4126ccf10c804878127ae284c..314ed7b24566a8c790983abe3f8b82594d2c7db0 100644 (file)
@@ -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);
index 49a2b8ca42df799f1815f8af32d15d492c9b3a2d..0168232e3b8db1da2a91dfd157db74740b99c9e6 100644 (file)
@@ -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;