febaa2
From ccb23fcac26e2a3712e2f25af6499a1d3b7e2882 Mon Sep 17 00:00:00 2001
febaa2
From: Gerd Hoffmann <kraxel@redhat.com>
febaa2
Date: Fri, 10 Sep 2021 11:42:03 +0200
febaa2
Subject: [PATCH 1/4] qxl: fix pre-save logic
febaa2
MIME-Version: 1.0
febaa2
Content-Type: text/plain; charset=UTF-8
febaa2
Content-Transfer-Encoding: 8bit
febaa2
febaa2
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
febaa2
RH-MergeRequest: 39: qxl: fix pre-save logic
febaa2
RH-Commit: [1/1] 126b1a352c63805bd23f5eb704515090eedc04e7
febaa2
RH-Bugzilla: 2002907
febaa2
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
febaa2
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
febaa2
RH-Acked-by: Marc-André Lureau <None>
febaa2
febaa2
Oops.  Logic is backwards.
febaa2
febaa2
Fixes: 39b8a183e2f3 ("qxl: remove assert in qxl_pre_save.")
febaa2
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/610
febaa2
Resolves: https://bugzilla.redhat.com//show_bug.cgi?id=2002907
febaa2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
febaa2
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
febaa2
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
febaa2
Message-Id: <20210910094203.3582378-1-kraxel@redhat.com>
febaa2
(cherry picked from commit eb94846280df3f1e2a91b6179fc05f9890b7e384)
febaa2
---
febaa2
 hw/display/qxl.c | 2 +-
febaa2
 1 file changed, 1 insertion(+), 1 deletion(-)
febaa2
febaa2
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
febaa2
index 43482d4364..29c80b4289 100644
febaa2
--- a/hw/display/qxl.c
febaa2
+++ b/hw/display/qxl.c
febaa2
@@ -2252,7 +2252,7 @@ static int qxl_pre_save(void *opaque)
febaa2
     } else {
febaa2
         d->last_release_offset = (uint8_t *)d->last_release - ram_start;
febaa2
     }
febaa2
-    if (d->last_release_offset < d->vga.vram_size) {
febaa2
+    if (d->last_release_offset >= d->vga.vram_size) {
febaa2
         return 1;
febaa2
     }
febaa2
 
febaa2
-- 
febaa2
2.18.2
febaa2