From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Roque Arcudia Hernandez <roqueh@google.com>,
ankeesler@google.com, mst@redhat.com, qemu-devel@nongnu.org,
venture@google.com
Subject: Re: [PATCH 1/2] ui: Allow injection of vnc display name
Date: Tue, 22 Oct 2024 08:53:38 +0100 [thread overview]
Message-ID: <ZxdaAtp6QlpqRSDs@redhat.com> (raw)
In-Reply-To: <CAMxuvax3ZRcGGE7Lyq=j-3pGtJ3jThw+rFyHhdBbhbUCyVs6+g@mail.gmail.com>
On Mon, Oct 21, 2024 at 03:14:39PM +0400, Marc-André Lureau wrote:
> Hi Roque
>
> On Fri, Oct 18, 2024 at 1:53 AM Roque Arcudia Hernandez
> <roqueh@google.com> wrote:
> >
> > From: Andrew Keesler <ankeesler@google.com>
> >
> > Thanks to 72d277a7, 1ed2cb32, and others, EDID (Extended Display Identification
> > Data) is propagated by QEMU such that a virtual display presents legitimate
> > metadata (e.g., name, serial number, preferred resolutions, etc.) to its
> > connected guest.
> >
> > This change propagates an optional user-provided display name to
> > QemuConsole. Future changes will update downstream devices to leverage this
> > display name for various uses, the primary one being providing a custom EDID
> > name to guests. Future changes will also update other displays (e.g., spice)
> > with a similar option to propagate a display name to downstream devices.
> >
> > Currently, every virtio-gpu virtual display has the same name: "QEMU
> > Monitor". We hope to be able to inject the EDID name of virtual displays in
> > order to test guest behavior that is specific to display names. We provide the
> > ability to inject the display name from the display configuration as that most
> > closely resembles how real displays work (hardware displays contain static EDID
> > information that is provided to every connected host).
> >
> > It should also be noted that EDID names longer than 12 bytes will be truncated
> > per spec (I think?).
> >
> > Signed-off-by: Andrew Keesler <ankeesler@google.com>
> > Signed-off-by: Roque Arcudia Hernandez <roqueh@google.com>
> > ---
> > include/ui/console.h | 1 +
> > ui/console-priv.h | 1 +
> > ui/console.c | 8 ++++++++
> > ui/vnc.c | 8 +++++++-
> > 4 files changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/ui/console.h b/include/ui/console.h
> > index 5832d52a8a..74ab03ed72 100644
> > --- a/include/ui/console.h
> > +++ b/include/ui/console.h
> > @@ -408,6 +408,7 @@ int qemu_console_get_index(QemuConsole *con);
> > uint32_t qemu_console_get_head(QemuConsole *con);
> > int qemu_console_get_width(QemuConsole *con, int fallback);
> > int qemu_console_get_height(QemuConsole *con, int fallback);
> > +void qemu_console_set_name(QemuConsole *con, const char *name);
> > /* Return the low-level window id for the console */
> > int qemu_console_get_window_id(QemuConsole *con);
> > /* Set the low-level window id for the console */
> > diff --git a/ui/console-priv.h b/ui/console-priv.h
> > index 43ceb8122f..9f2769843f 100644
> > --- a/ui/console-priv.h
> > +++ b/ui/console-priv.h
> > @@ -18,6 +18,7 @@ struct QemuConsole {
> > Object parent;
> >
> > int index;
> > + const char *name;
> > DisplayState *ds;
> > DisplaySurface *surface;
> > DisplayScanout scanout;
> > diff --git a/ui/console.c b/ui/console.c
> > index 5165f17125..f377fd8417 100644
> > --- a/ui/console.c
> > +++ b/ui/console.c
> > @@ -1452,6 +1452,14 @@ int qemu_console_get_height(QemuConsole *con, int fallback)
> > }
> > }
> >
> > +void qemu_console_set_name(QemuConsole *con, const char *name)
> > +{
> > + if (con == NULL) {
> > + return;
> > + }
> > + con->name = name;
> > +}
> > +
> > int qemu_invalidate_text_consoles(void)
> > {
> > QemuConsole *s;
> > diff --git a/ui/vnc.c b/ui/vnc.c
> > index 93a8dbd253..7d6acc5c2e 100644
> > --- a/ui/vnc.c
> > +++ b/ui/vnc.c
> > @@ -3595,6 +3595,9 @@ static QemuOptsList qemu_vnc_opts = {
> > },{
> > .name = "power-control",
> > .type = QEMU_OPT_BOOL,
> > + },{
> > + .name = "name",
> > + .type = QEMU_OPT_STRING,
> > },
> > { /* end of list */ }
> > },
> > @@ -4016,7 +4019,7 @@ void vnc_display_open(const char *id, Error **errp)
> > QemuOpts *opts = qemu_opts_find(&qemu_vnc_opts, id);
> > g_autoptr(SocketAddressList) saddr_list = NULL;
> > g_autoptr(SocketAddressList) wsaddr_list = NULL;
> > - const char *share, *device_id;
> > + const char *share, *device_id, *name;
> > QemuConsole *con;
> > bool password = false;
> > bool reverse = false;
> > @@ -4217,6 +4220,9 @@ void vnc_display_open(const char *id, Error **errp)
> > }
> > qkbd_state_set_delay(vd->kbd, key_delay_ms);
> >
> > + name = qemu_opt_get(opts, "name");
> > + qemu_console_set_name(vd->dcl.con, name);
>
> Why not expose a "head_name" property in QemuGraphicConsole?
QemuGraphicConsole isn't mapped to any CLI though, is it ?
In QAPI we have DisplayOptions union for all the local displays,
and as a user I think I'd expect 'name' to be settable from
those.
For VNC/SPICE, we have not mapped to QAPI, but they do have their
own CLI options we can expose.
For runtime setting, we have a QMP "display-update" command, that
currently just lets you change VNC listening address, but was intended
to allow for any runtime display changes.
> This way it should be possible to set the name with QMP qom-set.
qom-set isn't a particularly nice interface, as things you can set
from that are not introspectable and have no type information that
can be queried.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-10-22 7:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 21:53 [PATCH 0/2] Allow injection of virtio-gpu EDID name Roque Arcudia Hernandez
2024-10-17 21:53 ` [PATCH 1/2] ui: Allow injection of vnc display name Roque Arcudia Hernandez
2024-10-21 11:14 ` Marc-André Lureau
2024-10-21 20:03 ` Andrew Keesler
2024-10-22 7:49 ` Marc-André Lureau
2024-10-22 7:55 ` Daniel P. Berrangé
2024-10-22 7:53 ` Daniel P. Berrangé [this message]
2024-10-22 8:04 ` Marc-André Lureau
2024-10-22 8:10 ` Daniel P. Berrangé
2024-10-22 8:36 ` Marc-André Lureau
2024-10-28 19:25 ` Andrew Keesler
2024-11-22 14:40 ` Andrew Keesler
2024-10-22 7:14 ` Daniel P. Berrangé
2024-10-17 21:53 ` [PATCH 2/2] hw/display: Allow injection of virtio-gpu EDID name Roque Arcudia Hernandez
2024-11-25 12:04 ` Daniel P. Berrangé
2024-11-25 20:54 ` Andrew Keesler
2024-11-26 16:03 ` Daniel P. Berrangé
2024-11-26 21:07 ` Andrew Keesler
2024-12-02 20:31 ` Andrew Keesler
2024-12-05 16:59 ` Daniel P. Berrangé
2024-12-10 9:27 ` Markus Armbruster
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=ZxdaAtp6QlpqRSDs@redhat.com \
--to=berrange@redhat.com \
--cc=ankeesler@google.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=roqueh@google.com \
--cc=venture@google.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).