[PATCH qemu 1/2] add the ability to specify Spice keepalive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



add the ability to specify Spice keepalive

Signed-off-by: Sunny Shin <sunny4s.git@xxxxxxxxx>
---
 qemu-options.hx |  4 ++++
 ui/spice-core.c | 15 +++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/qemu-options.hx b/qemu-options.hx
index 0eea4ee..bc8fe42 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -995,6 +995,7 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice,
     "       [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
     "       [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
     "       [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
+    "       [,keepalive-timeout=<timeout>]\n"
     "   enable spice\n"
     "   at least one of {port, tls-port} is mandatory\n",
     QEMU_ARCH_ALL)
@@ -1086,6 +1087,9 @@ Enable/disable audio stream compression (using celt 0.5.1).  Default is on.
 @item seamless-migration=[on|off]
 Enable/disable spice seamless migration. Default is off.

+@item keepalive-timeout=[<timeout>]
+Enable tcp keepalive and set timeout as specified value.
+
 @end table
 ETEXI

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 6a62d71..1ffff9b 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -496,6 +496,9 @@ static QemuOptsList qemu_spice_opts = {
         }, {
             .name = "seamless-migration",
             .type = QEMU_OPT_BOOL,
+        }, {
+            .name = "keepalive-timeout",
+            .type = QEMU_OPT_NUMBER,
         },
         { /* end of list */ }
     },
@@ -644,6 +647,7 @@ void qemu_spice_init(void)
     spice_image_compression_t compression;
     spice_wan_compression_t wan_compr;
     bool seamless_migration;
+    int keepalive_timeout;

     qemu_thread_get_self(&me);

@@ -794,6 +798,17 @@ void qemu_spice_init(void)

     seamless_migration = qemu_opt_get_bool(opts, "seamless-migration", 0);
     spice_server_set_seamless_migration(spice_server, seamless_migration);
+
+    keepalive_timeout = qemu_opt_get_number(opts, "keepalive-timeout", 0);
+    if (keepalive_timeout > 0) {
+#if SPICE_SERVER_VERSION >= 0x000c06
+        spice_server_set_keepalive_timeout(spice_server, keepalive_timeout);
+#else
+        error_report("this qemu build does not support the "
+                     "\"keepalive-timeout\" option");
+#endif
+    }
+
     if (spice_server_init(spice_server, &core_interface) != 0) {
         error_report("failed to initialize spice server");
         exit(1);
--
2.5.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]