Received: from eggs.gnu.org ([208.118.235.92]:57048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USkie-0004sZ-0B for qemu-devel@nongnu.org; Thu, 18 Apr 2013 05:01:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USkiY-0007hO-I9 for qemu-devel@nongnu.org; Thu, 18 Apr 2013 05:01:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USkiY-0007h6-9j for qemu-devel@nongnu.org; Thu, 18 Apr 2013 05:01:22 -0400 From: Gerd Hoffmann Date: Thu, 18 Apr 2013 11:01:16 +0200 Message-Id: <1366275680-15416-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1366275680-15416-1-git-send-email-kraxel@redhat.com> References: <1366275680-15416-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/5] console: Hook QemuConsoles into qom tree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Gerd Hoffmann , lcapitulino@redhat.com Put them named "console[$index]" below "/backend", so you can list & inspect them via QMP. Signed-off-by: Gerd Hoffmann --- ui/console.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/console.c b/ui/console.c index e9f3080..b92bde3 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1541,6 +1541,8 @@ static DisplayState *get_alloc_displaystate(void) */ DisplayState *init_displaystate(void) { + Error *local_err = NULL; + gchar *name; int i; if (!display_state) { @@ -1552,6 +1554,14 @@ DisplayState *init_displaystate(void) consoles[i]->ds == NULL) { text_console_do_init(consoles[i]->chr, display_state); } + + /* Hook up into the qom tree here (not in new_console()), once + * all QemuConsoles are created and the order / numbering + * doesn't change any more */ + name = g_strdup_printf("console[%d]", i); + object_property_add_child(container_get(object_get_root(), "/backend"), + name, OBJECT(consoles[i]), &local_err); + g_free(name); } return display_state; -- 1.7.9.7