aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2023-01-12 15:02:47 +0100
committerMichael S. Tsirkin <mst@redhat.com>2023-01-28 06:21:29 -0500
commit2efe88a94863d5ca6ec04126b9090c2c2cd64f97 (patch)
treed34c509f620f1de319dd07dd4351dee81e94b3ce
parent2f447a36e7336129886db224661f9151f27b853c (diff)
downloadqemu-2efe88a94863d5ca6ec04126b9090c2c2cd64f97.zip
qemu-2efe88a94863d5ca6ec04126b9090c2c2cd64f97.tar.gz
qemu-2efe88a94863d5ca6ec04126b9090c2c2cd64f97.tar.bz2
tests: boot_sector_test(): make it multi-shot
if the function is called the 2nd time within the same qtest session, it will prematurely return before boot sector is executed due to remaining signature. Follow up patch will add VM reboot to a test case and will call boot_sector_test() again within the same qtest env, which may lead to above issue. To fix it make sure signature in VM RAM is no more before exiting boot_sector_test(), so next time it's called it will wait boot sector is completed again. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-16-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--tests/qtest/boot-sector.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/qtest/boot-sector.c b/tests/qtest/boot-sector.c
index d3f6801..679ee17 100644
--- a/tests/qtest/boot-sector.c
+++ b/tests/qtest/boot-sector.c
@@ -153,6 +153,8 @@ void boot_sector_test(QTestState *qts)
signature_high = qtest_readb(qts, SIGNATURE_ADDR + 1);
signature = (signature_high << 8) | signature_low;
if (signature == SIGNATURE) {
+ /* wipe signature */
+ qtest_writeb(qts, SIGNATURE_ADDR, 0x00);
break;
}