[Spice-commits] 2 commits - configure.ac NEWS server/tests

Alon Levy alon at kemper.freedesktop.org
Sun Sep 2 11:08:30 PDT 2012


 NEWS                        |   26 ++++++++++
 configure.ac                |    6 +-
 server/tests/Makefile.am    |    8 +++
 server/tests/test_vdagent.c |  107 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 144 insertions(+), 3 deletions(-)

New commits:
commit 8ac808918c96785f3795c253ea302f613f6413de
Author: Alon Levy <alevy at redhat.com>
Date:   Sun Sep 2 19:45:40 2012 +0300

    0.11.3 release
    
    No new api entries.

diff --git a/NEWS b/NEWS
index 68369af..cd06e04 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,29 @@
+Major changes in 0.11.3:
+========================
+* !Development Release!
+* This entry contains all 0.11.0 .. 0.11.3 changes.
+* Support seamless migration: no loss of in transit messages. Still not
+  supported for agent, smartcard and usb.
+* Support a new rendering message, Composite, for much improved linux guest
+  performance.
+* Support arbitrary resolution & multiple monitors on a single display channel.
+* Improved keyboard handling under network latency with new
+  SPICE_MSGC_INPUTS_KEY_SCANCODE message.
+* New libspice-server.so symbols:
+ spice_server_set_seamless_migration
+ spice_server_vm_stop
+ spice_server_vm_start
+ spice_qxl_monitors_config_async
+* New capabilities:
+ SPICE_DISPLAY_CAP_COMPOSITE
+ SPICE_DISPLAY_CAP_MONITORS_CONFIG
+ SPICE_INPUTS_CAP_KEY_SCANCODE
+ SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS
+ SPICE_MAIN_CAP_SEAMLESS_MIGRATE
+* Misc:
+ * char_device.c: Introducing shared flow control code for char devices
+ * Enable build without client, cegui and slirp.
+
 Major changes in 0.11.0:
 ========================
 * !Development Release!
diff --git a/configure.ac b/configure.ac
index 79eeb3b..cb7bed1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,10 +12,10 @@ AC_PREREQ([2.57])
 
 m4_define([SPICE_MAJOR], 0)
 m4_define([SPICE_MINOR], 11)
-m4_define([SPICE_MICRO], 2)
-m4_define([SPICE_CURRENT], [3])
+m4_define([SPICE_MICRO], 3)
+m4_define([SPICE_CURRENT], [4])
 m4_define([SPICE_REVISION], [0])
-m4_define([SPICE_AGE], [2])
+m4_define([SPICE_AGE], [3])
 
 # Note on the library name on linux (SONAME) produced by libtool (for reference, gleaned
 # from looking at libtool 2.4.2)
commit a6b2c10c1e4038929d6e5c4a73292a8c7a6a3eb7
Author: Alon Levy <alevy at redhat.com>
Date:   Sun Sep 2 14:42:18 2012 +0300

    add server/tests/test_vdagent

diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
index a49f3b3..e0472f3 100644
--- a/server/tests/Makefile.am
+++ b/server/tests/Makefile.am
@@ -34,6 +34,14 @@ noinst_PROGRAMS =						\
 	test_playback						\
 	test_display_resolution_changes		\
 	test_two_servers					\
+	test_vdagent						\
+	$(NULL)
+
+test_vdagent_SOURCES =		\
+	$(COMMON_BASE)				\
+	test_display_base.c			\
+	test_display_base.h			\
+	test_vdagent.c		\
 	$(NULL)
 
 test_display_streaming_SOURCES =		\
diff --git a/server/tests/test_vdagent.c b/server/tests/test_vdagent.c
new file mode 100644
index 0000000..bb267dd
--- /dev/null
+++ b/server/tests/test_vdagent.c
@@ -0,0 +1,107 @@
+/**
+ * Test vdagent guest to server messages
+ */
+
+#include <string.h>
+#include <config.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <spice/vd_agent.h>
+
+#include "test_display_base.h"
+
+SpiceCoreInterface *core;
+SpiceTimer *ping_timer;
+
+int ping_ms = 100;
+
+#ifndef MIN
+#define MIN(a, b) ((a) > (b) ? (b) : (a))
+#endif
+
+void pinger(void *opaque)
+{
+    // show_channels is not thread safe - fails if disconnections / connections occur
+    //show_channels(server);
+
+    core->timer_start(ping_timer, ping_ms);
+}
+
+
+static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
+{
+    return len;
+}
+
+static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
+{
+    static uint8_t c = 0;
+    static uint8_t message[2048];
+    static unsigned pos = 0;
+    static unsigned message_size;
+    int ret;
+
+    if (pos == 0) {
+        VDIChunkHeader *hdr = (VDIChunkHeader *)message;
+        VDAgentMessage *msg = (VDAgentMessage *)&hdr[1];
+        uint8_t *p = message;
+        int size = sizeof(message);
+        message_size = size;
+        /* fill in message */
+        hdr->port = VDP_SERVER_PORT;
+        hdr->size = message_size - sizeof(VDIChunkHeader);
+        msg->protocol = VD_AGENT_PROTOCOL;
+        msg->type = VD_AGENT_END_MESSAGE;
+        msg->opaque = 0;
+        msg->size = message_size - sizeof(VDIChunkHeader) - sizeof(VDAgentMessage);
+        size -= sizeof(VDIChunkHeader) + sizeof(VDAgentMessage);
+        p += sizeof(VDIChunkHeader) + sizeof(VDAgentMessage);
+        for (; size; --size, ++p, ++c)
+            *p = c;
+    }
+    ret = MIN(message_size - pos, len);
+    memcpy(buf, &message[pos], ret);
+    pos += ret;
+    if (pos == message_size) {
+        pos = 0;
+    }
+    //printf("vmc_read %d (ret %d)\n", len, ret);
+    return ret;
+}
+
+static void vmc_state(SpiceCharDeviceInstance *sin, int connected)
+{
+}
+
+static SpiceCharDeviceInterface vmc_interface = {
+    .base.type          = SPICE_INTERFACE_CHAR_DEVICE,
+    .base.description   = "test spice virtual channel char device",
+    .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
+    .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
+    .state              = vmc_state,
+    .write              = vmc_write,
+    .read               = vmc_read,
+};
+
+SpiceCharDeviceInstance vmc_instance = {
+    .subtype = "vdagent",
+};
+
+int main(void)
+{
+    Test *test;
+
+    core = basic_event_loop_init();
+    test = test_new(core);
+
+    vmc_instance.base.sif = &vmc_interface.base;
+    spice_server_add_interface(test->server, &vmc_instance.base);
+
+    ping_timer = core->timer_add(pinger, NULL);
+    core->timer_start(ping_timer, ping_ms);
+
+    basic_event_loop_mainloop();
+
+    return 0;
+}


More information about the Spice-commits mailing list