diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2021-03-17 10:56:22 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-03-26 09:33:50 +0100 |
commit | adcf33a504de29feb720736051dc32889314c9e6 (patch) | |
tree | c8e8785a83fa1fdc2f27be2202fc7d674e0f2b4f /hw/s390x | |
parent | 2dd9d8cfb4f3bd30d9cdfc2edba5cb7ee5917f4b (diff) |
s390x: modularize virtio-gpu-ccw
Since the virtio-gpu-ccw device depends on the hw-display-virtio-gpu
module, which provides the type virtio-gpu-device, packaging the
hw-display-virtio-gpu module as a separate package that may or may not
be installed along with the qemu package leads to problems. Namely if
the hw-display-virtio-gpu is absent, qemu continues to advertise
virtio-gpu-ccw, but it aborts not only when one attempts using
virtio-gpu-ccw, but also when libvirtd's capability probing tries
to instantiate the type to introspect it.
Let us thus introduce a module named hw-s390x-virtio-gpu-ccw that
is going to provide the virtio-gpu-ccw device. The hw-s390x prefix
was chosen because it is not a portable device.
With virtio-gpu-ccw built as a module, the correct way to package a
modularized qemu is to require that hw-display-virtio-gpu must be
installed whenever the module hw-s390x-virtio-gpu-ccw.
Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
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-4-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r-- | hw/s390x/meson.build | 8 | ||||
-rw-r--r-- | hw/s390x/virtio-ccw-gpu.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/hw/s390x/meson.build b/hw/s390x/meson.build index 91495b5631..327e9c93af 100644 --- a/hw/s390x/meson.build +++ b/hw/s390x/meson.build @@ -34,7 +34,6 @@ virtio_ss.add(files('virtio-ccw.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-ccw-balloon.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-ccw-blk.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-ccw-crypto.c')) -virtio_ss.add(when: 'CONFIG_VIRTIO_GPU', if_true: files('virtio-ccw-gpu.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_INPUT', if_true: files('virtio-ccw-input.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio-ccw-net.c')) virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-ccw-rng.c')) @@ -48,3 +47,10 @@ virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs-ccw.c' s390x_ss.add_all(when: 'CONFIG_VIRTIO_CCW', if_true: virtio_ss) hw_arch += {'s390x': s390x_ss} + +hw_s390x_modules = {} +virtio_gpu_ccw_ss = ss.source_set() +virtio_gpu_ccw_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_CCW'], + if_true: [files('virtio-ccw-gpu.c'), pixman]) +hw_s390x_modules += {'virtio-gpu-ccw': virtio_gpu_ccw_ss} +modules += {'hw-s390x': hw_s390x_modules} diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c index c301e2586b..75a9e4bb39 100644 --- a/hw/s390x/virtio-ccw-gpu.c +++ b/hw/s390x/virtio-ccw-gpu.c @@ -62,7 +62,9 @@ static const TypeInfo virtio_ccw_gpu = { static void virtio_ccw_gpu_register(void) { - type_register_static(&virtio_ccw_gpu); + if (have_virtio_ccw) { + type_register_static(&virtio_ccw_gpu); + } } type_init(virtio_ccw_gpu_register) |