mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
tests/qtest: don't attempt to clock_step while waiting for virtio ISR
This replicates the changes from 92cb8f8bf6
(tests/qtest: remove
clock_steps from virtio tests) as there are no timers in the virtio
code. We still busy wait and timeout though.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250207153112.3939799-3-alex.bennee@linaro.org>
This commit is contained in:
parent
0fa0b5edaa
commit
059d06c8a8
2 changed files with 4 additions and 8 deletions
|
@ -173,13 +173,11 @@ static bool get_config_isr_status(QVirtioDevice *d)
|
||||||
|
|
||||||
static void wait_config_isr_status(QVirtioDevice *d, gint64 timeout_us)
|
static void wait_config_isr_status(QVirtioDevice *d, gint64 timeout_us)
|
||||||
{
|
{
|
||||||
QVirtioPCIDevice *dev = container_of(d, QVirtioPCIDevice, vdev);
|
|
||||||
gint64 start_time = g_get_monotonic_time();
|
gint64 start_time = g_get_monotonic_time();
|
||||||
|
|
||||||
do {
|
while (!get_config_isr_status(d)) {
|
||||||
g_assert(g_get_monotonic_time() - start_time <= timeout_us);
|
g_assert(g_get_monotonic_time() - start_time <= timeout_us);
|
||||||
qtest_clock_step(dev->pdev->bus->qts, 100);
|
}
|
||||||
} while (!get_config_isr_status(d));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void queue_select(QVirtioDevice *d, uint16_t index)
|
static void queue_select(QVirtioDevice *d, uint16_t index)
|
||||||
|
|
|
@ -171,13 +171,11 @@ static bool qvirtio_pci_get_config_isr_status(QVirtioDevice *d)
|
||||||
static void qvirtio_pci_wait_config_isr_status(QVirtioDevice *d,
|
static void qvirtio_pci_wait_config_isr_status(QVirtioDevice *d,
|
||||||
gint64 timeout_us)
|
gint64 timeout_us)
|
||||||
{
|
{
|
||||||
QVirtioPCIDevice *dev = container_of(d, QVirtioPCIDevice, vdev);
|
|
||||||
gint64 start_time = g_get_monotonic_time();
|
gint64 start_time = g_get_monotonic_time();
|
||||||
|
|
||||||
do {
|
while (!qvirtio_pci_get_config_isr_status(d)) {
|
||||||
g_assert(g_get_monotonic_time() - start_time <= timeout_us);
|
g_assert(g_get_monotonic_time() - start_time <= timeout_us);
|
||||||
qtest_clock_step(dev->pdev->bus->qts, 100);
|
}
|
||||||
} while (!qvirtio_pci_get_config_isr_status(d));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qvirtio_pci_queue_select(QVirtioDevice *d, uint16_t index)
|
static void qvirtio_pci_queue_select(QVirtioDevice *d, uint16_t index)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue