From: "Cédric Le Goater" <clegoate@redhat.com>
To: Thomas Huth <thuth@redhat.com>,
qemu-s390x@nongnu.org,
Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: qemu-devel@nongnu.org, "Halil Pasic" <pasic@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"David Hildenbrand" <david@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility
Date: Thu, 2 May 2024 09:57:23 +0200 [thread overview]
Message-ID: <d4aa4852-196f-42bd-884f-5234f72bfad8@redhat.com> (raw)
In-Reply-To: <20240430190843.453903-1-thuth@redhat.com>
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)
next prev parent reply other threads:[~2024-05-02 7:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2024-05-02 8:00 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d4aa4852-196f-42bd-884f-5234f72bfad8@redhat.com \
--to=clegoate@redhat.com \
--cc=armbru@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=farman@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).