[Spice-devel] [PATCH v2] fixup! Change Drawable->pipes from Ring to GList
Frediano Ziglio
fziglio at redhat.com
Mon Sep 19 12:45:55 UTC 2016
> On Fri, 2016-09-16 at 12:57 -0400, Frediano Ziglio wrote:
> > >
> > >
> > > Fix potential infinite loop
> > > ---
> > > server/stream.c | 11 ++++-------
> > > 1 file changed, 4 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/server/stream.c b/server/stream.c
> > > index 934b236..49b5910 100644
> > > --- a/server/stream.c
> > > +++ b/server/stream.c
> > > @@ -331,11 +331,10 @@ void detach_stream(DisplayChannel *display,
> > > Stream
> > > *stream)
> > > static void before_reattach_stream(DisplayChannel *display,
> > > Stream *stream, Drawable
> > > *new_frame)
> > > {
> > > - RedDrawablePipeItem *dpi;
> > > DisplayChannelClient *dcc;
> > > int index;
> > > StreamAgent *agent;
> > > - GList *dpi_item;
> > > + GList *dpi_link, *dpi_next;
> > > GList *link, *link_next;
> > >
> > > spice_return_if_fail(stream->current);
> > > @@ -350,10 +349,9 @@ static void
> > > before_reattach_stream(DisplayChannel
> > > *display,
> > > }
> > >
> > > index = display_channel_get_stream_id(display, stream);
> > > - dpi_item = stream->current->pipes;
> > > - while (dpi_item) {
> > > - GList *dpi_next = dpi_item->next;
> > > - dpi = dpi_item->data;
> > > + for (dpi_link = stream->current->pipes; dpi_link; dpi_link =
> > > dpi_next) {
> > > + RedDrawablePipeItem *dpi = dpi_link->data;
> > > + dpi_next = dpi_link->next;
> > > dcc = dpi->dcc;
> > > agent = dcc_get_stream_agent(dcc, index);
> > >
> > > @@ -373,7 +371,6 @@ static void
> > > before_reattach_stream(DisplayChannel
> > > *display,
> > > ++agent->drops;
> > > }
> > > }
> > > - dpi_item = dpi_next;
> > > }
> > >
> > >
> >
> > Acked-by: Frediano Ziglio <fziglio at redhat.com>
> >
> > After all these fixup and changes I got this
> > https://cgit.freedesktop.org/~fziglio/spice-server/log/?h=jj2
> > (just if you want to check)
> >
> > I think we should be in a good state with the acks too.
> >
> > Frediano
>
> Here's what I had: https://cgit.freedesktop.org/~jjongsma/spice-server/
> log/?h=refactory-review
>
> I had already squashed a couple of your fixup patches. It seems that
> there is one difference between our branches. A change that Pavel
> suggested:
>
>
> $ git diff fziglio/jj2
> diff --git a/server/dcc.c b/server/dcc.c
> index 486d31b..f0a1ef8 100644
> --- a/server/dcc.c
> +++ b/server/dcc.c
> @@ -21,7 +21,6 @@
>
> #include "dcc-private.h"
> #include "display-channel.h"
> -#include "dcc.h"
> #include "red-channel-client-private.h"
>
> #define DISPLAY_CLIENT_SHORT_TIMEOUT 15000000000ULL //nano
> diff --git a/server/display-channel.c b/server/display-channel.c
> index c12020f..cd9c937 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -2065,15 +2065,15 @@ gboolean
> display_channel_validate_surface(DisplayChannel *display, uint32_t surf
> {
> if SPICE_UNLIKELY(surface_id >= display->priv->n_surfaces) {
> spice_warning("invalid surface_id %u", surface_id);
> - return 0;
> + return FALSE;
> }
> if (!display->priv->surfaces[surface_id].context.canvas) {
> spice_warning("canvas address is %p for %d (and is NULL)\n",
> &(display->priv-
> >surfaces[surface_id].context.canvas), surface_id);
> spice_warning("failed on %d", surface_id);
> - return 0;
> + return FALSE;
> }
> - return 1;
> + return TRUE;
> }
>
> void display_channel_update_monitors_config(DisplayChannel *display,
>
>
Good, push it!
Frediano
More information about the Spice-devel
mailing list