mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
libqos: use microseconds instead of iterations for virtio timeout
Some hosts are slow or overloaded so test execution takes a long time.
Test cases use timeouts to protect against an infinite loop stalling the
test forever (especially important in automated test setups).
Commit 6cd14054b6
("libqos virtio:
Increase ISR timeout") increased the clock_step() value in an attempt to
lengthen the virtio interrupt wait timeout, but timeout failures are
still occuring on the Travis automated testing platform.
This is because clock_step() only affects the guest's virtual time.
Virtio requests can be bottlenecked on host disk I/O latency - which
cannot be improved by stepping the clock, so the fix was ineffective.
This patch changes the qvirtio_wait_queue_isr() and
qvirtio_wait_config_isr() timeout mechanism from loop iterations to
microseconds. This way the test case can specify an absolute 30 second
timeout. Number of loop iterations is not a reliable timeout mechanism
since the speed depends on many factors including host performance.
Tests should no longer timeout on overloaded Travis instances.
Cc: Marc Marí <marc.mari.barcelo@gmail.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
e8c81b4d8a
commit
70556264a8
3 changed files with 42 additions and 43 deletions
|
@ -160,15 +160,15 @@ void qvirtio_set_acknowledge(const QVirtioBus *bus, QVirtioDevice *d);
|
|||
void qvirtio_set_driver(const QVirtioBus *bus, QVirtioDevice *d);
|
||||
void qvirtio_set_driver_ok(const QVirtioBus *bus, QVirtioDevice *d);
|
||||
|
||||
bool qvirtio_wait_queue_isr(const QVirtioBus *bus, QVirtioDevice *d,
|
||||
QVirtQueue *vq, uint64_t timeout);
|
||||
void qvirtio_wait_queue_isr(const QVirtioBus *bus, QVirtioDevice *d,
|
||||
QVirtQueue *vq, gint64 timeout_us);
|
||||
uint8_t qvirtio_wait_status_byte_no_isr(const QVirtioBus *bus,
|
||||
QVirtioDevice *d,
|
||||
QVirtQueue *vq,
|
||||
uint64_t addr,
|
||||
gint64 timeout_us);
|
||||
bool qvirtio_wait_config_isr(const QVirtioBus *bus, QVirtioDevice *d,
|
||||
uint64_t timeout);
|
||||
void qvirtio_wait_config_isr(const QVirtioBus *bus, QVirtioDevice *d,
|
||||
gint64 timeout_us);
|
||||
QVirtQueue *qvirtqueue_setup(const QVirtioBus *bus, QVirtioDevice *d,
|
||||
QGuestAllocator *alloc, uint16_t index);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue