On Tue, Mar 17, 2026 at 12:51:01PM +0400, Marc-André Lureau wrote: > Returning NULL without setting an error is odd. > > Note that we could make this a programming error too, as the duplicate > check is also done during QemuOpt parsing.
IMHO we shouldn't rely on QemuOpts given our general intent to get off QemuOpts to QMP for everything. > > Signed-off-by: Marc-André Lureau <[email protected]> > --- > ui/vnc.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Daniel P. Berrangé <[email protected]> > > diff --git a/ui/vnc.c b/ui/vnc.c > index 03b99c9e590..2c53c92914b 100644 > --- a/ui/vnc.c > +++ b/ui/vnc.c > @@ -3428,6 +3428,7 @@ VncDisplay *vnc_display_new(const char *id, Error > **errp) > VncDisplay *vd; > > if (vnc_display_find(id) != NULL) { > + error_setg(errp, "Display '%s' already exists", id); > return NULL; > } > vd = g_malloc0(sizeof(*vd)); > > -- > 2.53.0 > > 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 :|
