[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/27] get reference to /backend container via qemu_
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 06/27] get reference to /backend container via qemu_get_backend() |
Date: |
Thu, 21 Nov 2013 03:38:27 +0100 |
... API, so it could be reused later using qemu_get_backend()
without duplicating "/backend" everywhere.
Signed-off-by: Igor Mammedov <address@hidden>
---
include/sysemu/sysemu.h | 3 +++
ui/console.c | 3 ++-
vl.c | 11 +++++++++++
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index cd5791e..2a71293 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -9,6 +9,7 @@
#include "qapi-types.h"
#include "qemu/notify.h"
#include "qemu/main-loop.h"
+#include "qom/object.h"
/* vl.c */
@@ -87,6 +88,8 @@ void qemu_savevm_state_cancel(void);
uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size);
int qemu_loadvm_state(QEMUFile *f);
+Object *qemu_get_backend(void);
+
/* SLIRP */
void do_info_slirp(Monitor *mon);
diff --git a/ui/console.c b/ui/console.c
index aad4fc9..868d5a1 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -27,6 +27,7 @@
#include "qemu/timer.h"
#include "qmp-commands.h"
#include "sysemu/char.h"
+#include "sysemu/sysemu.h"
//#define DEBUG_CONSOLE
#define DEFAULT_BACKSCROLL 512
@@ -1598,7 +1599,7 @@ DisplayState *init_displaystate(void)
* 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"),
+ object_property_add_child(qemu_get_backend(),
name, OBJECT(consoles[i]), &local_err);
g_free(name);
}
diff --git a/vl.c b/vl.c
index 5974f0f..1de3d57 100644
--- a/vl.c
+++ b/vl.c
@@ -2846,6 +2846,17 @@ static void qemu_init_default_mem_opts(uint64_t size)
qemu_opt_set_number(opts, "slots", 0);
}
+Object *qemu_get_backend(void)
+{
+ static Object *obj;
+
+ if (obj == NULL) {
+ obj = container_get(object_get_root(), "/backend");
+ }
+
+ return obj;
+}
+
int main(int argc, char **argv, char **envp)
{
int i;
--
1.7.1
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, (continued)
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Markus Armbruster, 2013/11/21
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Igor Mammedov, 2013/11/25
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Michael S. Tsirkin, 2013/11/25
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Paolo Bonzini, 2013/11/25
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Eric Blake, 2013/11/25
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Paolo Bonzini, 2013/11/25
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Markus Armbruster, 2013/11/27
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Paolo Bonzini, 2013/11/27
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Markus Armbruster, 2013/11/27
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, Paolo Bonzini, 2013/11/27
[Qemu-devel] [PATCH 06/27] get reference to /backend container via qemu_get_backend(),
Igor Mammedov <=
[Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Igor Mammedov, 2013/11/20
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Paolo Bonzini, 2013/11/25
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Igor Mammedov, 2013/11/25
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Paolo Bonzini, 2013/11/25
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Igor Mammedov, 2013/11/27
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Paolo Bonzini, 2013/11/27
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Igor Mammedov, 2013/11/27
Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Eric Blake, 2013/11/27
[Qemu-devel] [PATCH 08/27] dimm: implement dimm device abstraction, Igor Mammedov, 2013/11/20