On 09/28/2011 01:15 AM, Uri Lublin wrote:
On 09/25/2011 03:36 PM, Yonit Halperin wrote:
(1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect
(2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR), or a
timeout, in order
to complete client_migrate_info monitor command

Signed-off-by: Yonit Halperin<yhalp...@redhat.com>
---
common/messages.h | 2 +
server/reds.c | 148 +++++++++++++++++++++++++++++++++++++++-------------
spice.proto | 5 +-
3 files changed, 115 insertions(+), 40 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index 99d52f9..845b0ee 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1891,6 +1900,23 @@ static int sync_write(RedsStream *stream, const
void *in_buf, size_t n)
return TRUE;
}

+static void reds_channel_set_caps(Channel *channel, int cap, int active)
+{
+ int nbefore, n;
+
+ nbefore = channel->num_caps;
+ n = cap / 32;
+ channel->num_caps = MAX(channel->num_caps, n + 1);
+ channel->caps = spice_renew(uint32_t, channel->caps,
channel->num_caps);
+ memset(channel->caps + nbefore, 0,
+ (channel->num_caps - nbefore) * sizeof(uint32_t));
+ if (active) {
+ channel->caps[n] |= (1<< cap);

I think this should be
channel->caps[n] |= (1<< (cap - (n * 32)));

Indeed, I forgot the (cap % 32), I will send a patch.
Thanks,
Yonit.
+ } else {
+ channel->caps[n]&= ~(1<< cap);

and same here

+ }
+}
+



Since currently n is always 0, it's just a nitpick at this point.

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

Reply via email to