Skip to content

Commit 2dd9d8c

Browse files
committed
s390x: add have_virtio_ccw
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>
1 parent d4c603d commit 2dd9d8c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

hw/s390x/virtio-ccw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
#define NR_CLASSIC_INDICATOR_BITS 64
3737

38+
bool have_virtio_ccw = true;
39+
3840
static int virtio_ccw_dev_post_load(void *opaque, int version_id)
3941
{
4042
VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(opaque);

hw/s390x/virtio-ccw.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ typedef struct VirtioBusClass VirtioCcwBusClass;
6363
DECLARE_OBJ_CHECKERS(VirtioCcwBusState, VirtioCcwBusClass,
6464
VIRTIO_CCW_BUS, TYPE_VIRTIO_CCW_BUS)
6565

66+
/*
67+
* modules can reference this symbol to avoid being loaded
68+
* into system emulators without ccw support
69+
*/
70+
extern bool have_virtio_ccw;
6671

6772
struct VirtIOCCWDeviceClass {
6873
CCWDeviceClass parent_class;

0 commit comments

Comments
 (0)