All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 48/67] ui/vnc: merge vnc_display_init() and vnc_display_open()
Date: Wed, 15 Apr 2026 17:14:00 +0100	[thread overview]
Message-ID: <ad-5SFF4anOYvA1P@redhat.com> (raw)
In-Reply-To: <fae0a954-fd89-49f7-848d-74f352036176@linaro.org>

On Sun, Apr 12, 2026 at 10:57:51PM +0200, Philippe Mathieu-Daudé wrote:
> On 12/4/26 16:17, Marc-André Lureau wrote:
> > Hi
> > 
> > On Sun, Apr 12, 2026 at 2:31 AM Philippe Mathieu-Daudé
> > <philmd@linaro.org> wrote:
> > > 
> > > On 10/4/26 21:19, Marc-André Lureau wrote:
> > > > Combine the two-step vnc_display_init()/vnc_display_open() sequence
> > > > into a single vnc_display_new() function that returns VncDisplay*.
> > > > This simplifies the API by making vnc_display_open() an
> > > > internal detail and will allow further code simplification.
> > > > 
> > > > vnc_display_new() is moved to vnc.h, since it returns VncDisplay* now.
> > > > Add vnc_display_free() for consistency, and it will be later used.
> > > > 
> > > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > ---
> > > >    include/ui/console.h |  2 --
> > > >    ui/vnc.h             |  3 +++
> > > >    ui/vnc.c             | 75 ++++++++++++++++++++++------------------------------
> > > >    3 files changed, 35 insertions(+), 45 deletions(-)
> > > 
> > > 
> > > > -bool vnc_display_init(const char *id, Error **errp)
> > > > +VncDisplay *vnc_display_new(const char *id, Error **errp)
> > > >    {
> > > >        VncDisplay *vd;
> > > > 
> > > >        if (vnc_display_find(id) != NULL) {
> > > > -        return true;
> > > > +        return NULL;
> > > 
> > > Can you explain why we don't return the VncDisplay found here?
> > 
> > `vnc_display_new()` is called from `vnc_init_func()`. If we have
> > duplicate IDs, the function returns NULL, which is treated as an
> > error.
> > 
> > Duplicate IDs are handled earlier by qemu_opts_create() though. So we
> > could assert() instead ?
> 
> That would make this code path clearer for sure.

Yeah, an assert(!vnc_display_find(id)) would make sense.


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  reply	other threads:[~2026-04-15 16:14 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 19:18 [PATCH v2 00/67] ui: add standalone VNC server over D-Bus Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 01/67] ui/vnc-jobs: remove needless buffer_reset() before end Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 02/67] ui/vnc: clarify intent using buffer_empty() function Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 03/67] ui/vnc-jobs: vnc_has_job_locked() argument cannot be NULL Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 04/67] ui/vnc-jobs: remove dead VncJobQueue.exit Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 05/67] ui/vnc-jobs: remove vnc_queue_clear() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 06/67] ui/vnc-jobs: narrow taking the queue lock Marc-André Lureau
2026-04-15  9:17   ` Daniel P. Berrangé
2026-04-10 19:18 ` [PATCH v2 07/67] ui/vnc-jobs: drop redundant (and needless) qemu_thread_get_self() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 08/67] ui/console-vc: fix off-by-one in CSI J 2 (clear entire screen) Marc-André Lureau
2026-04-11 22:42   ` Philippe Mathieu-Daudé
2026-04-10 19:18 ` [PATCH v2 09/67] ui/console-vc: add UTF-8 input decoding with CP437 rendering Marc-André Lureau
2026-04-15 11:24   ` Daniel P. Berrangé
2026-04-20  7:54     ` Marc-André Lureau
2026-04-29  8:30       ` Daniel P. Berrangé
2026-04-10 19:18 ` [PATCH v2 10/67] ui/console-vc: ignore string-type escape sequences Marc-André Lureau
2026-04-15  9:19   ` Daniel P. Berrangé
2026-04-10 19:18 ` [PATCH v2 11/67] ui/console-vc: fix comment shift-out/in comments Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 12/67] ui/console: dispatch get_label() through QOM virtual method Marc-André Lureau
2026-04-11 22:41   ` Philippe Mathieu-Daudé
2026-04-12 14:45     ` Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 13/67] ui/console-vc: introduce QemuVT100 Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 14/67] ui/console-vc: set vt100 associated pixman image Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 15/67] ui/console-vc: vga_putcharxy()->vt100_putcharxy() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 16/67] ui/console-vc: make invalidate_xy() take vt100 Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 17/67] ui/console-vc: make show_cursor() " Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 18/67] ui/console-vc: decouple VT100 display updates via function pointer Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 19/67] ui/console-vc: console_refresh() -> vt100_refresh() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 20/67] ui/console-vc: move cursor blinking logic into VT100 layer Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 21/67] ui/console-vc: console_scroll() -> vt100_scroll() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 22/67] ui/console-vc: refactor text_console_resize() into vt100_set_image() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 23/67] ui/console-vc: move vc_put_lf() to VT100 layer as vt100_put_lf() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 24/67] ui/console-vc: unify the write path Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 25/67] ui/console-vc: move VT100 state machine and output FIFO into QemuVT100 Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 26/67] ui/console-vc: extract vt100_input() from vc_chr_write() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 27/67] ui/console-vc: extract vt100_keysym() from qemu_text_console_handle_keysym() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 28/67] ui/console-vc: extract vt100_init() and vt100_fini() Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 29/67] ui/console: remove console_ch_t typedef and console_write_ch() Marc-André Lureau
2026-04-11 22:24   ` Philippe Mathieu-Daudé
2026-04-10 19:18 ` [PATCH v2 30/67] ui: avoid duplicating vgafont16 in each translation unit Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 31/67] ui/vgafont: add SPDX license header Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 32/67] ui: move FONT_WIDTH/HEIGHT to vgafont.h Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 33/67] ui/console-vc: move VT100 emulation into separate unit Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 34/67] util: move datadir.c from system/ Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 35/67] ui: move DisplaySurface functions to display-surface.c Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 36/67] ui: make qemu_default_pixelformat() static inline Marc-André Lureau
2026-04-10 19:18 ` [PATCH v2 37/67] ui: make unregister_displaychangelistener() skip unregistered Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 38/67] ui: minor code simplification Marc-André Lureau
2026-04-15 11:25   ` Daniel P. Berrangé
2026-04-10 19:19 ` [PATCH v2 39/67] system: make qemu_del_vm_change_state_handler accept NULL Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 40/67] ui/vnc: assert preconditions instead of silently returning Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 41/67] ui/vnc: simplify vnc_init_func error handling Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 42/67] ui/vnc: VncDisplay.id is not const Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 43/67] ui/keymaps: introduce kbd_layout_free() Marc-André Lureau
2026-04-11 22:26   ` Philippe Mathieu-Daudé
2026-04-12 14:10     ` Marc-André Lureau
2026-04-15 11:31   ` Daniel P. Berrangé
2026-04-10 19:19 ` [PATCH v2 44/67] ui/vnc: fix vnc_display_init() leak on failure Marc-André Lureau
2026-04-15 11:34   ` Daniel P. Berrangé
2026-04-10 19:19 ` [PATCH v2 45/67] ui/vnc: make vnc_disconnect_finish() private Marc-André Lureau
2026-04-11 22:27   ` Philippe Mathieu-Daudé
2026-04-15 11:34   ` Daniel P. Berrangé
2026-04-10 19:19 ` [PATCH v2 46/67] ui/vnc: make the worker thread per-VncDisplay Marc-André Lureau
2026-04-15 16:03   ` Daniel P. Berrangé
2026-04-20 15:03     ` Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 47/67] ui/vnc: vnc_display_init() and vnc_display_open() return bool Marc-André Lureau
2026-04-11 22:28   ` Philippe Mathieu-Daudé
2026-04-12 14:12     ` Marc-André Lureau
2026-04-15 16:11   ` Daniel P. Berrangé
2026-04-10 19:19 ` [PATCH v2 48/67] ui/vnc: merge vnc_display_init() and vnc_display_open() Marc-André Lureau
2026-04-11 22:31   ` Philippe Mathieu-Daudé
2026-04-12 14:17     ` Marc-André Lureau
2026-04-12 20:57       ` Philippe Mathieu-Daudé
2026-04-15 16:14         ` Daniel P. Berrangé [this message]
2026-04-10 19:19 ` [PATCH v2 49/67] ui/vnc: add vnc_cleanup() Marc-André Lureau
2026-04-15 11:56   ` Daniel P. Berrangé
2026-04-20 20:08     ` Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 50/67] ui/vnc: report an error for duplicate display id Marc-André Lureau
2026-04-11 22:33   ` Philippe Mathieu-Daudé
2026-04-10 19:19 ` [PATCH v2 51/67] ui/vnc: defer listener registration until the console is known Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 52/67] ui/vnc: expose vnc_disconnect_start() Marc-André Lureau
2026-04-15 12:19   ` Daniel P. Berrangé
2026-04-10 19:19 ` [PATCH v2 53/67] ui/vnc: remove left-over dead code Marc-André Lureau
2026-04-15 11:58   ` Daniel P. Berrangé
2026-04-10 19:19 ` [PATCH v2 54/67] ui/vnc: explicitly link with png Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 55/67] ui/vnc: add vnc-system unit, to allow different implementations Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 56/67] ui/console: remove qemu_console_is_visible() Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 57/67] ui/console: simplify registering display/console change listener Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 58/67] ui/console: add doc comment for qemu_console_{un}register_listener() Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 59/67] ui/console: return completion status from gfx_update callback Marc-André Lureau
2026-04-23 13:59   ` Philippe Mathieu-Daudé
2026-04-10 19:19 ` [PATCH v2 60/67] ui/console: rename public API to use consistent qemu_console_ prefix Marc-André Lureau
2026-04-11 22:38   ` Philippe Mathieu-Daudé
2026-04-10 19:19 ` [PATCH v2 61/67] ui/console: move console_handle_touch_event() to input Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 62/67] ui/vnc: replace VNC_DEBUG with trace-events Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 63/67] ui: extract common sources into a static library Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 64/67] tests: rename the dbus-daemon helper script Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 65/67] tests/qtest: fix dbus-vmstate-test compilation Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 66/67] tests/qtest: drop DBUS_VMSTATE_TEST_TMPDIR Marc-André Lureau
2026-04-10 19:19 ` [PATCH v2 67/67] tools/qemu-vnc: add standalone VNC server over D-Bus Marc-André Lureau

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=ad-5SFF4anOYvA1P@redhat.com \
    --to=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.