Skip to contentSkip to conversation

qxl: fix pre-save logic

PATCH In review Gerd Hoffmann 3 participants 3 messages Sep 10, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qxl: fix pre-save logic

Oops. Logic is backwards.

Fixes 39b8a183e2f3 ("qxl: remove assert in qxl_pre_save.")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/610
Resolves: https://bugzilla.redhat.com//show_bug.cgi?id=2002907

---
 hw/display/qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/qxl.c +1 -1
index 43482d4364ba..29c80b4289b7 100644
@@ -2252,7 +2252,7 @@ static int qxl_pre_save(void *opaque)
     } else {
         d->last_release_offset = (uint8_t *)d->last_release - ram_start;
     }
-    if (d->last_release_offset < d->vga.vram_size) {
+    if (d->last_release_offset >= d->vga.vram_size) {
         return 1;
     }
 
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Gerd Hoffmann

Oops. Logic is backwards.

Fixes 39b8a183e2f3 ("qxl: remove assert in qxl_pre_save.")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/610
Resolves: https://bugzilla.redhat.com//show_bug.cgi?id=2002907

Argh..

---

Quoted 21 lines
 hw/display/qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/qxl.c +1 -2
index 43482d4364ba..29c80b4289b7 100644
@@ -2252,7 +2252,7 @@ static int qxl_pre_save(void *opaque)
     } else {
         d->last_release_offset = (uint8_t *)d->last_release - ram_start;
     }
-    if (d->last_release_offset < d->vga.vram_size) {
+    if (d->last_release_offset >= d->vga.vram_size) {
         return 1;
     }
 
--

2.31.1

Signature · 1 line
Marc-André Lureau
Reviewed-by on v1 1/1
#2 lore raw
In reply to Gerd Hoffmann
Quoted 3 lines · Gerd Hoffmann

Oops. Logic is backwards.

Fixes 39b8a183e2f3 ("qxl: remove assert in qxl_pre_save.")

Urgh, I looked at that commit yesterday several times and was blind to the bug too !

Quoted 6 lines

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/610
Resolves: https://bugzilla.redhat.com//show_bug.cgi?id=2002907

---
 hw/display/qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 17 lines
hw/display/qxl.c +1 -1
index 43482d4364ba..29c80b4289b7 100644
@@ -2252,7 +2252,7 @@ static int qxl_pre_save(void *opaque)
     } else {
         d->last_release_offset = (uint8_t *)d->last_release - ram_start;
     }
-    if (d->last_release_offset < d->vga.vram_size) {
+    if (d->last_release_offset >= d->vga.vram_size) {
         return 1;
     }
 
Signature · 1 line
2.31.1

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|