[Spice-devel] [PATCH spice-server] Remove g_smartcard_channel global
Frediano Ziglio
fziglio at redhat.com
Thu Oct 27 09:21:03 UTC 2016
>
> I think I would have just switched this to a static variable, possibly a
> GOnce if you are worried about thread-safety.
>
> Acked-by: Christophe Fergeau <cfergeau at redhat.com>
>
> Christophe
>
This won't solve having 2 spice server instances on the same executable.
Frediano
> On Wed, Oct 26, 2016 at 10:29:42AM +0100, Frediano Ziglio wrote:
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> > server/reds.c | 2 +-
> > server/reds.h | 1 +
> > server/smartcard.c | 7 ++-----
> > 3 files changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/server/reds.c b/server/reds.c
> > index 45d23d4..19ca568 100644
> > --- a/server/reds.c
> > +++ b/server/reds.c
> > @@ -464,7 +464,7 @@ void reds_unregister_channel(RedsState *reds,
> > RedChannel *channel)
> > }
> > }
> >
> > -static RedChannel *reds_find_channel(RedsState *reds, uint32_t type,
> > uint32_t id)
> > +RedChannel *reds_find_channel(RedsState *reds, uint32_t type, uint32_t id)
> > {
> > GListIter it;
> > RedChannel *channel;
> > diff --git a/server/reds.h b/server/reds.h
> > index cd62fc1..28e3444 100644
> > --- a/server/reds.h
> > +++ b/server/reds.h
> > @@ -47,6 +47,7 @@ void reds_enable_mm_time(RedsState *reds);
> > uint32_t reds_get_mm_time(void);
> > void reds_register_channel(RedsState *reds, RedChannel *channel);
> > void reds_unregister_channel(RedsState *reds, RedChannel *channel);
> > +RedChannel *reds_find_channel(RedsState *reds, uint32_t type, uint32_t
> > id);
> > int reds_get_mouse_mode(RedsState *reds); // used by inputs_channel
> > gboolean reds_config_get_agent_mouse(const RedsState *reds); // used by
> > inputs_channel
> > int reds_has_vdagent(RedsState *reds); // used by inputs channel
> > diff --git a/server/smartcard.c b/server/smartcard.c
> > index 655eaf7..53919c0 100644
> > --- a/server/smartcard.c
> > +++ b/server/smartcard.c
> > @@ -602,14 +602,11 @@
> > red_smartcard_channel_class_init(RedSmartcardChannelClass *klass)
> >
> > }
> >
> > -/* FIXME: remove global */
> > -RedSmartcardChannel *g_smartcard_channel;
> > -
> > static void smartcard_init(RedsState *reds)
> > {
> > - spice_assert(!g_smartcard_channel);
> > + spice_assert(!reds_find_channel(reds, SPICE_CHANNEL_SMARTCARD, 0));
> >
> > - g_smartcard_channel = red_smartcard_channel_new(reds);
> > + red_smartcard_channel_new(reds);
> > }
> >
> >
> > --
> > 2.7.4
> >
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/spice-devel
>
More information about the Spice-devel
mailing list