Skip to content

Commit adcf33a

Browse files
committed
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>
1 parent 2dd9d8c commit adcf33a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

hw/s390x/meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ virtio_ss.add(files('virtio-ccw.c'))
3434
virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-ccw-balloon.c'))
3535
virtio_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-ccw-blk.c'))
3636
virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-ccw-crypto.c'))
37-
virtio_ss.add(when: 'CONFIG_VIRTIO_GPU', if_true: files('virtio-ccw-gpu.c'))
3837
virtio_ss.add(when: 'CONFIG_VIRTIO_INPUT', if_true: files('virtio-ccw-input.c'))
3938
virtio_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio-ccw-net.c'))
4039
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'
4847
s390x_ss.add_all(when: 'CONFIG_VIRTIO_CCW', if_true: virtio_ss)
4948

5049
hw_arch += {'s390x': s390x_ss}
50+
51+
hw_s390x_modules = {}
52+
virtio_gpu_ccw_ss = ss.source_set()
53+
virtio_gpu_ccw_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_CCW'],
54+
if_true: [files('virtio-ccw-gpu.c'), pixman])
55+
hw_s390x_modules += {'virtio-gpu-ccw': virtio_gpu_ccw_ss}
56+
modules += {'hw-s390x': hw_s390x_modules}

hw/s390x/virtio-ccw-gpu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ static const TypeInfo virtio_ccw_gpu = {
6262

6363
static void virtio_ccw_gpu_register(void)
6464
{
65-
type_register_static(&virtio_ccw_gpu);
65+
if (have_virtio_ccw) {
66+
type_register_static(&virtio_ccw_gpu);
67+
}
6668
}
6769

6870
type_init(virtio_ccw_gpu_register)

util/module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ static struct {
304304
{ "virtio-gpu-pci-base", "hw-", "display-virtio-gpu-pci" },
305305
{ "virtio-gpu-pci", "hw-", "display-virtio-gpu-pci" },
306306
{ "vhost-user-gpu-pci", "hw-", "display-virtio-gpu-pci" },
307+
{ "virtio-gpu-ccw", "hw-", "s390x-virtio-gpu-ccw" },
307308
{ "virtio-vga-base", "hw-", "display-virtio-vga" },
308309
{ "virtio-vga", "hw-", "display-virtio-vga" },
309310
{ "vhost-user-vga", "hw-", "display-virtio-vga" },

0 commit comments

Comments
 (0)