From d0dbefcd985976878af2cbf6d4332e8d58fb9267 Mon Sep 17 00:00:00 2001 From: sungmin ha Date: Wed, 3 Sep 2014 15:12:57 +0900 Subject: [PATCH] spice-server: added auto port setting for tizen Change-Id: Ifff5499cbc30b2f5d6571d33881773bd1f131e34 Signed-off-by: sungmin ha --- tizen/src/emul_state.c | 6 ++++++ tizen/src/emul_state.h | 2 ++ ui/spice-core.c | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/tizen/src/emul_state.c b/tizen/src/emul_state.c index a629cb7edb..02bdca72f6 100644 --- a/tizen/src/emul_state.c +++ b/tizen/src/emul_state.c @@ -187,6 +187,12 @@ void set_emul_vm_base_port(int port) _emul_info.device_serial_number = port + 1; _emul_info.ecs_port = port + 3; _emul_info.serial_port = port + 4; + _emul_info.spice_port = port + 5; +} + +int get_emul_spice_port(void) +{ + return _emul_info.spice_port; } void set_emul_ecs_port(int port) diff --git a/tizen/src/emul_state.h b/tizen/src/emul_state.h index 043ea458a6..9e59d5bbb0 100644 --- a/tizen/src/emul_state.h +++ b/tizen/src/emul_state.h @@ -95,6 +95,7 @@ typedef struct EmulatorConfigInfo { int vm_base_port; int device_serial_number; int ecs_port; + int spice_port; char *vm_name; /* add here */ int serial_port; @@ -149,6 +150,7 @@ int get_emul_vm_base_port(void); int get_device_serial_number(void); int get_emul_ecs_port(void); int get_emul_serial_port(void); +int get_emul_spice_port(void); int get_emulator_condition(void); short get_emul_rotation(void); diff --git a/ui/spice-core.c b/ui/spice-core.c index 4cce3b38c0..b7d869b75a 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -39,6 +39,10 @@ #include "hw/hw.h" #include "ui/spice-display.h" +#ifdef CONFIG_MARU +extern int get_emul_spice_port(void); +#endif + /* core bits */ static SpiceServer *spice_server; @@ -648,7 +652,12 @@ void qemu_spice_init(void) if (!opts) { return; } + +#ifdef CONFIG_MARU + port = get_emul_spice_port(); +#else port = qemu_opt_get_number(opts, "port", 0); +#endif tls_port = qemu_opt_get_number(opts, "tls-port", 0); if (!port && !tls_port) { error_report("neither port nor tls-port specified for spice"); -- 2.34.1