[Spice-devel] [PATCH 4/4] channel: use iface parameter to distinguish interface context

Uri Lublin uril at redhat.com
Wed Jan 6 11:45:34 PST 2016


On 01/06/2016 07:09 PM, Christophe Fergeau wrote:
> On Mon, Dec 21, 2015 at 10:33:12AM +0000, Frediano Ziglio wrote:
>> ---
>>   server/red-worker.c | 12 +++++-------
>>   1 file changed, 5 insertions(+), 7 deletions(-)
>>
>> diff --git a/server/red-worker.c b/server/red-worker.c
>> index b0b7df1..0347404 100644
>> --- a/server/red-worker.c
>> +++ b/server/red-worker.c
>> @@ -71,6 +71,7 @@ struct RedWorker {
>>       QXLInstance *qxl;
>>       RedDispatcher *red_dispatcher;
>>       int running;
>> +    SpiceCoreInterfaceInternal core;
>>       struct pollfd poll_fds[MAX_EVENT_SOURCES];
>>       struct SpiceWatch watches[MAX_EVENT_SOURCES];
>>       unsigned int event_timeout;
>> @@ -534,16 +535,12 @@ static void worker_watch_update_mask(SpiceWatch *watch, int event_mask)
>>   static SpiceWatch *worker_watch_add(const SpiceCoreInterfaceInternal *iface,
>>                                       int fd, int event_mask, SpiceWatchFunc func, void *opaque)
>>   {
>> +    RedWorker *worker = SPICE_CONTAINEROF(iface, RedWorker, core);
>>       /* Since we are a channel core implementation, we always get called from
>>          red_channel_client_create(), so opaque always is our rcc */
>>       RedChannelClient *rcc = opaque;
>
> I would remove this, or at least move this to the block where it's used
> (some debug statement in an error case).

Maybe just replace the current initialization of worker.



More information about the Spice-devel mailing list