[Spice-devel] [PATCH 1/2] replay: fix check for QXL_SURF_FLAG_KEEP_DATA flag

Fabiano Fidencio ffidenci at redhat.com
Tue Aug 25 02:47:42 PDT 2015


On Tue, Aug 25, 2015 at 11:43 AM, Frediano Ziglio <fziglio at redhat.com>
wrote:

> A logical and (&&) was used instead of a bit one (&).
> Was working just as is the only flag defined.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red_record_qxl.c | 2 +-
>  server/red_replay_qxl.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/server/red_record_qxl.c b/server/red_record_qxl.c
> index d96fb79..b35b462 100644
> --- a/server/red_record_qxl.c
> +++ b/server/red_record_qxl.c
> @@ -724,7 +724,7 @@ static void red_record_surface_cmd(FILE *fd,
> RedMemSlotInfo *slots, int group_id
>          fprintf(fd, "u.surface_create.height %d\n",
> qxl->u.surface_create.height);
>          fprintf(fd, "u.surface_create.stride %d\n",
> qxl->u.surface_create.stride);
>          size = qxl->u.surface_create.height *
> abs(qxl->u.surface_create.stride);
> -        if (qxl->flags && QXL_SURF_FLAG_KEEP_DATA) {
> +        if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
>              write_binary(fd, "data", size,
>                  (uint8_t*)get_virt(slots, qxl->u.surface_create.data,
> size, group_id,
>                                     &error));
> diff --git a/server/red_replay_qxl.c b/server/red_replay_qxl.c
> index a010a58..5044adf 100644
> --- a/server/red_replay_qxl.c
> +++ b/server/red_replay_qxl.c
> @@ -1025,7 +1025,7 @@ static QXLSurfaceCmd
> *red_replay_surface_cmd(SpiceReplay *replay)
>          replay_fscanf(replay, "u.surface_create.height %d\n",
> &qxl->u.surface_create.height);
>          replay_fscanf(replay, "u.surface_create.stride %d\n",
> &qxl->u.surface_create.stride);
>          size = qxl->u.surface_create.height *
> abs(qxl->u.surface_create.stride);
> -        if (qxl->flags && QXL_SURF_FLAG_KEEP_DATA) {
> +        if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
>              read_binary(replay, "data", &read_size,
> (uint8_t**)&qxl->u.surface_create.data, 0);
>              if (read_size != size) {
>                  spice_printerr("mismatch %ld != %ld", size, read_size);
> --
> 2.4.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>


ACK!
-- 
Fabiano FidĂȘncio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150825/b186af03/attachment.html>


More information about the Spice-devel mailing list