Re: [PATCH spice-gtk 2/5] main channel: reseting channel caps

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


On 05/17/2012 02:11 PM, Marc-André Lureau wrote:
On Thu, May 17, 2012 at 11:20 AM, Yonit Halperin<yhalperi@xxxxxxxxxx>  wrote:
+static void spice_main_channel_reset_capabilties(SpiceChannel *channel)
+{
+    spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE);
+    spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_MAIN_CAP_NAME_AND_UUID);
+}
+

It should chain up to call the default/overriden
spice_channel_reset_capabilities().

I guess calling parent_class->reset_capabilties(channel); first.

Otherwise, since we may want to clear in all cases:

replace channel_reset():
{
-    SPICE_CHANNEL_GET_CLASS(channel)->channel_reset_capabilities(channel);
+   spice_channel_reset_capabilities(channel)
}

And call the virtual method in spice_channel_reset_capabilities()

static void spice_channel_reset_capabilities(SpiceChannel *channel)
{

     SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel);
     g_array_set_size(c->caps, 0);
+  if (SPICE_CHANNEL_GET_CLASS(channel)->channel_reset_capabilities)
+   SPICE_CHANNEL_GET_CLASS(channel)->channel_reset_capabilities(channel);
}


Will do the second option, thanks.

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



[Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Tools]     [DDR & Rambus]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

Add to Google