[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] hw/s390x: modularize virtio-gpu-ccw

From: Halil Pasic
Subject: Re: [PATCH 1/1] hw/s390x: modularize virtio-gpu-ccw
Date: Fri, 19 Feb 2021 10:42:52 +0100

On Fri, 19 Feb 2021 09:45:45 +0100
Gerd Hoffmann <kraxel@redhat.com> wrote:

> > but that "fixes" s390x at the expense
> > of breaking all the other targets. For example:
> > ./qemu-system-x86_64 -device help
> > Type 'virtio-gpu-ccw' is missing its parent 'virtio-ccw-device'
> > Aborted  
> Hmm, this is a new failure variant.  In the PCI case (see other mail)
> the module doesn't load in the first place due to missing symbols.
> Maybe we need a type_register_mayfail() variant which doesn't abort in
> case the parent isn't found (see also commit
> 501093207eb1ed4845e0a65ee1ce7db7b9676e0b).

I was also thinking along the same lines last night, and came up with
this workaround:

diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c
index c301e2586b..bbe591cd62 100644
--- a/hw/s390x/virtio-ccw-gpu.c
+++ b/hw/s390x/virtio-ccw-gpu.c
@@ -62,7 +62,16 @@ static const TypeInfo virtio_ccw_gpu = {
 static void virtio_ccw_gpu_register(void)
+    /*
+     * Ugly hack: Avoid targets that don't have it aborting when this module
+     * is loaded.
+    if (object_class_by_name(TYPE_VIRTIO_CCW_DEVICE)) {
+        type_register_static(&virtio_ccw_gpu);
+    }

but then I decided it is too ugly to post. Something like
type_register_mayfail() would be certainly nicer, although I would still
prefer the failing type register if the device ain't built as a module.

Today I'm on a vacation so I will pick this up again next week. I will
also think some more of how the situation with virtio-ccw compares to pci
with respect to modularization.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]