[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: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v2 36/37] ui/dbus: register D-Bus VC handler |
Date: |
Fri, 17 Dec 2021 14:35:38 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 |
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 = "";
}
> + if (!qemu_opt_set(opts, "name", name, errp)) {
> + return;
> + }
> + }
> +
> + klass->parent_parse(opts, backend, errp);
> +}
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
- Re: [PATCH v2 36/37] ui/dbus: register D-Bus VC handler,
Philippe Mathieu-Daudé <=