qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility
@ 2024-04-30 19:08 Thomas Huth
  2024-04-30 19:19 ` David Hildenbrand
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Thomas Huth @ 2024-04-30 19:08 UTC (permalink / raw)
  To: qemu-s390x, Christian Borntraeger
  Cc: qemu-devel, Halil Pasic, Eric Farman, David Hildenbrand,
	Markus Armbruster, Philippe Mathieu-Daudé

The sclpconsole currently does not have a proper parent in the QOM
tree, so it shows up under /machine/unattached - which is somewhat
ugly. We should rather attach it to /machine/sclp/s390-sclp-event-facility
where the other devices of type TYPE_SCLP_EVENT already reside.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/s390x/s390-virtio-ccw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 5c83d1ea17..41be8bf857 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -242,11 +242,13 @@ static void s390_create_virtio_net(BusState *bus, const char *name)
 
 static void s390_create_sclpconsole(const char *type, Chardev *chardev)
 {
+    BusState *ev_fac_bus = sclp_get_event_facility_bus();
     DeviceState *dev;
 
     dev = qdev_new(type);
+    object_property_add_child(OBJECT(ev_fac_bus->parent), type, OBJECT(dev));
     qdev_prop_set_chr(dev, "chardev", chardev);
-    qdev_realize_and_unref(dev, sclp_get_event_facility_bus(), &error_fatal);
+    qdev_realize_and_unref(dev, ev_fac_bus, &error_fatal);
 }
 
 static void ccw_init(MachineState *machine)
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility
  2024-04-30 19:08 [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility Thomas Huth
@ 2024-04-30 19:19 ` David Hildenbrand
  2024-04-30 19:32 ` Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2024-04-30 19:19 UTC (permalink / raw)
  To: Thomas Huth, qemu-s390x, Christian Borntraeger
  Cc: qemu-devel, Halil Pasic, Eric Farman, Markus Armbruster,
	Philippe Mathieu-Daudé

On 30.04.24 21:08, Thomas Huth wrote:
> The sclpconsole currently does not have a proper parent in the QOM
> tree, so it shows up under /machine/unattached - which is somewhat
> ugly. We should rather attach it to /machine/sclp/s390-sclp-event-facility
> where the other devices of type TYPE_SCLP_EVENT already reside.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   hw/s390x/s390-virtio-ccw.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 5c83d1ea17..41be8bf857 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -242,11 +242,13 @@ static void s390_create_virtio_net(BusState *bus, const char *name)
>   
>   static void s390_create_sclpconsole(const char *type, Chardev *chardev)
>   {
> +    BusState *ev_fac_bus = sclp_get_event_facility_bus();
>       DeviceState *dev;
>   
>       dev = qdev_new(type);
> +    object_property_add_child(OBJECT(ev_fac_bus->parent), type, OBJECT(dev));
>       qdev_prop_set_chr(dev, "chardev", chardev);
> -    qdev_realize_and_unref(dev, sclp_get_event_facility_bus(), &error_fatal);
> +    qdev_realize_and_unref(dev, ev_fac_bus, &error_fatal);
>   }
>   
>   static void ccw_init(MachineState *machine)

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility
  2024-04-30 19:08 [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility Thomas Huth
  2024-04-30 19:19 ` David Hildenbrand
@ 2024-04-30 19:32 ` Philippe Mathieu-Daudé
  2024-05-01 14:23 ` Eric Farman
  2024-05-02  7:57 ` Cédric Le Goater
  3 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-04-30 19:32 UTC (permalink / raw)
  To: Thomas Huth, qemu-s390x, Christian Borntraeger
  Cc: qemu-devel, Halil Pasic, Eric Farman, David Hildenbrand,
	Markus Armbruster

On 30/4/24 21:08, Thomas Huth wrote:
> The sclpconsole currently does not have a proper parent in the QOM
> tree, so it shows up under /machine/unattached - which is somewhat
> ugly. We should rather attach it to /machine/sclp/s390-sclp-event-facility
> where the other devices of type TYPE_SCLP_EVENT already reside.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   hw/s390x/s390-virtio-ccw.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility
  2024-04-30 19:08 [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility Thomas Huth
  2024-04-30 19:19 ` David Hildenbrand
  2024-04-30 19:32 ` Philippe Mathieu-Daudé
@ 2024-05-01 14:23 ` Eric Farman
  2024-05-02  7:57 ` Cédric Le Goater
  3 siblings, 0 replies; 6+ messages in thread
From: Eric Farman @ 2024-05-01 14:23 UTC (permalink / raw)
  To: Thomas Huth, qemu-s390x, Christian Borntraeger
  Cc: qemu-devel, Halil Pasic, David Hildenbrand, Markus Armbruster,
	Philippe Mathieu-Daudé

On Tue, 2024-04-30 at 21:08 +0200, Thomas Huth wrote:
> The sclpconsole currently does not have a proper parent in the QOM
> tree, so it shows up under /machine/unattached - which is somewhat
> ugly. We should rather attach it to /machine/sclp/s390-sclp-event-
> facility
> where the other devices of type TYPE_SCLP_EVENT already reside.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/s390x/s390-virtio-ccw.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Eric Farman <farman@linux.ibm.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility
  2024-04-30 19:08 [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility Thomas Huth
                   ` (2 preceding siblings ...)
  2024-05-01 14:23 ` Eric Farman
@ 2024-05-02  7:57 ` Cédric Le Goater
  2024-05-02  8:00   ` Thomas Huth
  3 siblings, 1 reply; 6+ messages in thread
From: Cédric Le Goater @ 2024-05-02  7:57 UTC (permalink / raw)
  To: Thomas Huth, qemu-s390x, Christian Borntraeger
  Cc: qemu-devel, Halil Pasic, Eric Farman, David Hildenbrand,
	Markus Armbruster, Philippe Mathieu-Daudé

On 4/30/24 21:08, Thomas Huth wrote:
> The sclpconsole currently does not have a proper parent in the QOM
> tree, so it shows up under /machine/unattached - which is somewhat
> ugly. We should rather attach it to /machine/sclp/s390-sclp-event-facility
> where the other devices of type TYPE_SCLP_EVENT already reside.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Cédric Le Goater <clg@redhat.com>

> ---
>   hw/s390x/s390-virtio-ccw.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 5c83d1ea17..41be8bf857 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -242,11 +242,13 @@ static void s390_create_virtio_net(BusState *bus, const char *name)
>   
>   static void s390_create_sclpconsole(const char *type, Chardev *chardev)
>   {
> +    BusState *ev_fac_bus = sclp_get_event_facility_bus();

This routine sclp_get_event_facility_bus() which scans all the machine
could be avoided and even removed. For that, SCLPDevice should be an
attribute of the machine. This means reshuffling definitions and
object instanciations a little in the code. Would you be OK with that ?

Other machine units/models could undergo the same kind of changes.

Thanks,

C.

>       DeviceState *dev;
>   
>       dev = qdev_new(type);
> +    object_property_add_child(OBJECT(ev_fac_bus->parent), type, OBJECT(dev));
>       qdev_prop_set_chr(dev, "chardev", chardev);
> -    qdev_realize_and_unref(dev, sclp_get_event_facility_bus(), &error_fatal);
> +    qdev_realize_and_unref(dev, ev_fac_bus, &error_fatal);
>   }
>   
>   static void ccw_init(MachineState *machine)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility
  2024-05-02  7:57 ` Cédric Le Goater
@ 2024-05-02  8:00   ` Thomas Huth
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2024-05-02  8:00 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-s390x, Christian Borntraeger
  Cc: qemu-devel, Halil Pasic, Eric Farman, David Hildenbrand,
	Markus Armbruster, Philippe Mathieu-Daudé

On 02/05/2024 09.57, Cédric Le Goater wrote:
> On 4/30/24 21:08, Thomas Huth wrote:
>> The sclpconsole currently does not have a proper parent in the QOM
>> tree, so it shows up under /machine/unattached - which is somewhat
>> ugly. We should rather attach it to /machine/sclp/s390-sclp-event-facility
>> where the other devices of type TYPE_SCLP_EVENT already reside.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
> 
> Reviewed-by: Cédric Le Goater <clg@redhat.com>
> 
>> ---
>>   hw/s390x/s390-virtio-ccw.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
>> index 5c83d1ea17..41be8bf857 100644
>> --- a/hw/s390x/s390-virtio-ccw.c
>> +++ b/hw/s390x/s390-virtio-ccw.c
>> @@ -242,11 +242,13 @@ static void s390_create_virtio_net(BusState *bus, 
>> const char *name)
>>   static void s390_create_sclpconsole(const char *type, Chardev *chardev)
>>   {
>> +    BusState *ev_fac_bus = sclp_get_event_facility_bus();
> 
> This routine sclp_get_event_facility_bus() which scans all the machine
> could be avoided and even removed. For that, SCLPDevice should be an
> attribute of the machine. This means reshuffling definitions and
> object instanciations a little in the code. Would you be OK with that ?

Sounds like a good clean-up, yes!

  Thomas




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-02  8:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30 19:08 [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility Thomas Huth
2024-04-30 19:19 ` David Hildenbrand
2024-04-30 19:32 ` Philippe Mathieu-Daudé
2024-05-01 14:23 ` Eric Farman
2024-05-02  7:57 ` Cédric Le Goater
2024-05-02  8:00   ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).