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

2021-03-03 Thread Halil Pasic
On Wed, 3 Mar 2021 08:07:50 +0100 Gerd Hoffmann wrote: > Hi, > > > The only approaches I can think of to make type_register_mayfail() > > "work" involve adding a dependency check in type_register_internal() > > before the call to type_table_add() is made. This can "work" for modules, > > becau

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

2021-03-02 Thread Gerd Hoffmann
Hi, > The only approaches I can think of to make type_register_mayfail() > "work" involve adding a dependency check in type_register_internal() > before the call to type_table_add() is made. This can "work" for modules, > because for types loaded from we can hope, that all dependencies are > alr

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

2021-02-25 Thread Halil Pasic
On Wed, 24 Feb 2021 17:46:34 +0100 Halil Pasic wrote: > On Wed, 24 Feb 2021 12:36:17 +0100 > Gerd Hoffmann wrote: [..] > > > > > -static TypeImpl *type_register_internal(const TypeInfo *info) > > > +static TypeImpl *type_register_internal(const TypeInfo *info, bool > > > mayfail) > > > { >

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

2021-02-25 Thread Gerd Hoffmann
Hi, > a programming error. So I'm absolutely against shoving this logic > down into object.c. But I find the variant I posted nicer to document > and nicer to read: looking at virtio_ccw_gpu_register() one sees > immediately that if built as a module, it is OK if the registration > fails, and if

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

2021-02-24 Thread Halil Pasic
On Wed, 24 Feb 2021 12:36:17 +0100 Gerd Hoffmann wrote: > > static void virtio_ccw_gpu_register(void) > > { > > +#ifdef CONFIG_MODULES > > +type_register_static_mayfail(&virtio_ccw_gpu); > > +#else > > type_register_static(&virtio_ccw_gpu); > > +#endif > > Move the ifdef to type_reg

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

2021-02-24 Thread Gerd Hoffmann
> static void virtio_ccw_gpu_register(void) > { > +#ifdef CONFIG_MODULES > +type_register_static_mayfail(&virtio_ccw_gpu); > +#else > type_register_static(&virtio_ccw_gpu); > +#endif Move the ifdef to type_register_static_mayfail, so this is not duplicated for every module which might n

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

2021-02-23 Thread Halil Pasic
On Mon, 22 Feb 2021 17:30:50 + Daniel P. Berrangé wrote: > > Paolo, Daniel, > > I am in general (s390 unrelated) a bit puzzled about the scenario of QEMU > > being modularized. > > Libvirt probes QEMU executables for their capabilities and creates a > > capabilities cache of the probed QEMU b

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

2021-02-22 Thread Daniel P . Berrangé
On Mon, Feb 22, 2021 at 06:18:57PM +0100, Boris Fiuczynski wrote: > Paolo, Daniel, > I am in general (s390 unrelated) a bit puzzled about the scenario of QEMU > being modularized. > Libvirt probes QEMU executables for their capabilities and creates a > capabilities cache of the probed QEMU binary.

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

2021-02-22 Thread Boris Fiuczynski
Paolo, Daniel, I am in general (s390 unrelated) a bit puzzled about the scenario of QEMU being modularized. Libvirt probes QEMU executables for their capabilities and creates a capabilities cache of the probed QEMU binary. There are a few triggers that invalidate the cache. One is the QEMU bina

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

2021-02-22 Thread Halil Pasic
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-gp