spice-server: added auto port setting for tizen 01/27001/3
authorsungmin ha <sungmin82.ha@samsung.com>
Wed, 3 Sep 2014 06:12:57 +0000 (15:12 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Thu, 4 Sep 2014 12:18:54 +0000 (21:18 +0900)
Change-Id: Ifff5499cbc30b2f5d6571d33881773bd1f131e34
Signed-off-by: sungmin ha <sungmin82.ha@samsung.com>
tizen/src/emul_state.c
tizen/src/emul_state.h
ui/spice-core.c

index a629cb7edb1b1ef28e0cab0167b50600c5516921..02bdca72f6e7ccc54c34c85dc0f404c836115301 100644 (file)
@@ -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)
index 043ea458a6a07ad623fd7b47dc767425fd0a42cf..9e59d5bbb0718e355e36d0ca02afa26385d7f1a2 100644 (file)
@@ -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);
index 4cce3b38c006d7caef404a3749f42e58848843c2..b7d869b75aad0d6ca3f786deff0b1af1094f155e 100644 (file)
 #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");