[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 36/37] ui/dbus: register D-Bus VC handler
From: |
Marc-André Lureau |
Subject: |
Re: [PATCH v2 36/37] ui/dbus: register D-Bus VC handler |
Date: |
Fri, 17 Dec 2021 18:21:02 +0400 |
On Fri, Dec 17, 2021 at 5:35 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> On 10/9/21 23:08, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Export the default consoles over the D-Bus chardev.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> > ui/dbus.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 53 insertions(+)
>
> > +static void
> > +dbus_vc_parse(QemuOpts *opts, ChardevBackend *backend,
> > + Error **errp)
> > +{
> > + DBusVCClass *klass =
> > DBUS_VC_CLASS(object_class_by_name(TYPE_CHARDEV_VC));
> > + const char *name = qemu_opt_get(opts, "name");
> > + const char *id = qemu_opts_id(opts);
> > +
> > + if (name == NULL) {
> > + name = "";
>
> Could also drop this assignation, and:
>
> > + if (g_str_has_prefix(id, "compat_monitor")) {
> > + name = "org.qemu.monitor.hmp.0";
> > + }
>
> else
>
> > + if (g_str_has_prefix(id, "serial")) {
> > + name = "org.qemu.console.serial.0";
> > + }
>
> else {
> name = "";
> }
>
done
> > + if (!qemu_opt_set(opts, "name", name, errp)) {
> > + return;
> > + }
> > + }
> > +
> > + klass->parent_parse(opts, backend, errp);
> > +}
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
thanks