From 6b3e1a3a3964b97a2f76111b45205631567dff39 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Sun, 13 Jun 2021 11:26:14 +0100 Subject: [PATCH] esp: fix migration version check in esp_is_version_5() 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 Fixes: 4e78f3bf35 ("esp: defer command completion interrupt on incoming data transfers") Message-Id: <20210613102614.5438-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Paolo Bonzini --- 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 3e6f4094fcc8a..8fad87be9d60a 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -1128,7 +1128,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)