Skip to content

Commit

Permalink
esp: fix migration version check in esp_is_version_5()
Browse files Browse the repository at this point in the history
Commit 4e78f3b "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: 4e78f3b ("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 <pbonzini@redhat.com>
  • Loading branch information
mcayland authored and bonzini committed Jun 14, 2021
1 parent 5668ab9 commit 6b3e1a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/scsi/esp.c
Expand Up @@ -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)
Expand Down

0 comments on commit 6b3e1a3

Please sign in to comment.