summaryrefslogtreecommitdiffstats
path: root/server/red_channel.c
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-08-08 12:13:25 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-08-27 09:04:18 +0300
commit49a8d68303f3d8681a9c61d74e0675279649d480 (patch)
treeb29a292e06cc5fc640345eda95209e45e0fbed51 /server/red_channel.c
parent37be9e0c2efd21e088e8106b4356de7fcbe5a95b (diff)
downloadspice-49a8d68303f3d8681a9c61d74e0675279649d480.tar.gz
spice-49a8d68303f3d8681a9c61d74e0675279649d480.tar.xz
spice-49a8d68303f3d8681a9c61d74e0675279649d480.zip
red_channel: add red_channel_test_remote_cap
for checking if all the channel clients connected support the cap
Diffstat (limited to 'server/red_channel.c')
-rw-r--r--server/red_channel.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index 2a7acbfc..1cad9eb3 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -560,6 +560,34 @@ int red_channel_client_test_remote_cap(RedChannelClient *rcc, uint32_t cap)
cap);
}
+int red_channel_test_remote_common_cap(RedChannel *channel, uint32_t cap)
+{
+ RingItem *link;
+
+ RING_FOREACH(link, &channel->clients) {
+ RedChannelClient *rcc = SPICE_CONTAINEROF(link, RedChannelClient, channel_link);
+
+ if (!red_channel_client_test_remote_common_cap(rcc, cap)) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+int red_channel_test_remote_cap(RedChannel *channel, uint32_t cap)
+{
+ RingItem *link;
+
+ RING_FOREACH(link, &channel->clients) {
+ RedChannelClient *rcc = SPICE_CONTAINEROF(link, RedChannelClient, channel_link);
+
+ if (!red_channel_client_test_remote_cap(rcc, cap)) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
static int red_channel_client_pre_create_validate(RedChannel *channel, RedClient *client)
{
if (red_client_get_channel(client, channel->type, channel->id)) {