On Wed, Nov 20, 2024 at 04:56:56PM -0500, Peter Xu wrote:
> Follow the trend to explicitly create containers, do that for console.c on
> "/backend" container.
>
> Cc: Marc-André Lureau <[email protected]>
> Signed-off-by: Peter Xu <[email protected]>
> ---
> ui/console.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ui/console.c b/ui/console.c
> index 5165f17125..36f8c6debb 100644
> --- a/ui/console.c
> +++ b/ui/console.c
> @@ -1154,14 +1154,14 @@ DisplayState *init_displaystate(void)
> {
> gchar *name;
> QemuConsole *con;
> + Object *backend = container_create(object_get_root(), "backend");
What's the rationale for keeping this in the console code ?
I'd consider this to be a similar situation to '/chardevs' and
'/objects', and be a common container rather than UI specific.
IOW, be created by your later patch.
>
> QTAILQ_FOREACH(con, &consoles, next) {
> /* Hook up into the qom tree here (not in object_new()), once
> * all QemuConsoles are created and the order / numbering
> * doesn't change any more */
> name = g_strdup_printf("console[%d]", con->index);
> - object_property_add_child(container_get(object_get_root(),
> "/backend"),
> - name, OBJECT(con));
> + object_property_add_child(backend, name, OBJECT(con));
> g_free(name);
> }
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 :|