qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] esp: fix migration version check in esp_is_version_5()
@ 2021-06-13 10:26 Mark Cave-Ayland
  2021-06-14  5:42 ` Philippe Mathieu-Daudé
  2021-06-14  8:15 ` Paolo Bonzini
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Cave-Ayland @ 2021-06-13 10:26 UTC (permalink / raw)
  To: pbonzini, qemu-devel, laurent, hpoussin

Commit 4e78f3bf35 "esp: defer command completion interrupt on incoming data
transfers" added a version check for use with VMSTATE_*_TEST macros to allow
migration from older QEMU versions. Unfortunately the version check fails to
work in its current form since if the VMStateDescription version_id is
incremented, the test returns false and so the fields are not included in the
outgoing migration stream.

Change the version check to use >= rather == to ensure that migration works
correctly when the ESPState VMStateDescription has version_id > 5.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fixes: 4e78f3bf35 ("esp: defer command completion interrupt on incoming data transfers")
---
 hw/scsi/esp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index bfdb94292b..39756ddd99 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -1120,7 +1120,7 @@ static bool esp_is_version_5(void *opaque, int version_id)
     ESPState *s = ESP(opaque);
 
     version_id = MIN(version_id, s->mig_version_id);
-    return version_id == 5;
+    return version_id >= 5;
 }
 
 int esp_pre_save(void *opaque)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-15  7:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 10:26 [PATCH] esp: fix migration version check in esp_is_version_5() Mark Cave-Ayland
2021-06-14  5:42 ` Philippe Mathieu-Daudé
2021-06-14  7:44   ` Mark Cave-Ayland
2021-06-14  9:01     ` Philippe Mathieu-Daudé
2021-06-14 11:59       ` Mark Cave-Ayland
2021-06-14 13:47         ` Philippe Mathieu-Daudé
2021-06-15  7:42           ` Mark Cave-Ayland
2021-06-14  8:15 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).