qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	lcapitulino@redhat.com
Subject: [Qemu-devel] [PATCH 2/5] console: Hook QemuConsoles into qom tree
Date: Thu, 18 Apr 2013 11:01:16 +0200	[thread overview]
Message-ID: <1366275680-15416-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1366275680-15416-1-git-send-email-kraxel@redhat.com>

Put them named "console[$index]" below "/backend", so you can
list & inspect them via QMP.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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

  parent reply	other threads:[~2013-04-18  9:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18  9:01 [Qemu-devel] [RfC PATCH 0/5] console: qom-ify & extent screendump monitor command Gerd Hoffmann
2013-04-18  9:01 ` [Qemu-devel] [PATCH 1/5] console: qom-ify QemuConsole Gerd Hoffmann
2013-04-18  9:01 ` Gerd Hoffmann [this message]
2013-04-18  9:01 ` [Qemu-devel] [PATCH 3/5] console: add device link to QemuConsoles Gerd Hoffmann
2013-04-18  9:01 ` [Qemu-devel] [PATCH 4/5] console: add qemu_console_lookup_by_device Gerd Hoffmann
2013-04-18  9:01 ` [Qemu-devel] [PATCH 5/5] console: extend screendump monitor cmd Gerd Hoffmann
2013-04-18 12:10 ` [Qemu-devel] [RfC PATCH 0/5] console: qom-ify & extent screendump monitor command Eric Blake
2013-04-18 15:21   ` Luiz Capitulino
2013-04-18 15:34     ` Eric Blake
2013-04-22  7:19       ` Gerd Hoffmann
2013-04-19  8:37 ` Markus Armbruster
2013-04-19 13:03   ` Eric Blake
2013-04-22  6:55   ` Gerd Hoffmann
2013-04-22  9:37     ` Paolo Bonzini
2013-04-22 12:50       ` Luiz Capitulino
2013-04-22 13:00         ` Paolo Bonzini
2013-04-22 16:49           ` Anthony Liguori
2013-04-22 17:03             ` Paolo Bonzini
2013-04-22 17:23               ` Eric Blake
2013-04-23  5:15                 ` Gerd Hoffmann
2013-04-22 17:56               ` Anthony Liguori
2013-04-23 11:57                 ` Gerd Hoffmann
2013-04-25 20:55 ` Anthony Liguori
2013-04-25 21:17   ` Luiz Capitulino
2013-04-25 21:55     ` Eric Blake
2013-04-25 22:19       ` Anthony Liguori
2013-04-25 22:19     ` Anthony Liguori
2013-04-26  0:41       ` Luiz Capitulino

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=1366275680-15416-3-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=lcapitulino@redhat.com \
    --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 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).