@samitouri / QOSamiQemu / commits / be791f06b2

qtest/ide-test: convert to use qtest qemu-io command

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260828-qemu-no-hmp-v5-24-9227de146347@redhat.com>

Marc-André Lureau committed Aug 28, 2026 at 16:04 UTC be791f06b23b2868c32896abd7d8c522fbb33e21
2 files changed +4 -5
tests/qtest/ahci-test.c
+2 -3
@@ -1758,8 +1758,7 @@ static void test_atapi_engine_restart_in_flight(bool dma)
1758 qtest_memset(ahci->parent->qts, buffer, 0x00, ATAPI_SECTOR_SIZE);
1759
1760 /* Suspend the next backend read so the ATAPI read stays in flight. */
1761 - g_free(qtest_hmp(ahci->parent->qts,
1762 - "qemu-io drive0 \"break read_aio rd\""));
1761 + qtest_qemu_io(ahci->parent->qts, "drive0", "break read_aio rd");
1762
1763 cmd = ahci_atapi_command_create(CMD_ATAPI_READ_10, ATAPI_SECTOR_SIZE,
1764 dma);
@@ -1771,7 +1770,7 @@ static void test_atapi_engine_restart_in_flight(bool dma)
1770 ahci_px_clr(ahci, port, AHCI_PX_CMD, AHCI_PX_CMD_ST);
1771 ahci_px_set(ahci, port, AHCI_PX_CMD, AHCI_PX_CMD_ST);
1772
1774 - g_free(qtest_hmp(ahci->parent->qts, "qemu-io drive0 \"resume rd\""));
1773 + qtest_qemu_io(ahci->parent->qts, "drive0", "resume rd");
1774
1775 /* Round-trip through the device to confirm qemu is still alive. */
1776 ahci_px_rreg(ahci, port, AHCI_PX_TFD);
tests/qtest/ide-test.c
+2 -2
@@ -839,7 +839,7 @@ static void test_flush(void)
839 make_dirty(qts, 0);
840
841 /* Delay the completion of the flush request until we explicitly do it */
842 - g_free(qtest_hmp(qts, "qemu-io ide0-hd0 \"break flush_to_os A\""));
842 + qtest_qemu_io(qts, "ide0-hd0", "break flush_to_os A");
843
844 /* FLUSH CACHE command on device 0*/
845 qpci_io_writeb(dev, ide_bar, reg_device, 0);
@@ -851,7 +851,7 @@ static void test_flush(void)
851 assert_bit_clear(data, DF | ERR | DRQ);
852
853 /* Complete the command */
854 - g_free(qtest_hmp(qts, "qemu-io ide0-hd0 \"resume A\""));
854 + qtest_qemu_io(qts, "ide0-hd0", "resume A");
855
856 /* Check registers */
857 data = qpci_io_readb(dev, ide_bar, reg_device);