Skip to content

qtest: fix "device_del" out-of-order events

Peter Xu qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4libqtest: add qmp_device_del()tests/libqtest.c tests/libqtest.h+56 -02 replies
2/4tests: use qmp_device_del() where propertests/libqos/usb.c tests/usb-hcd-uhci-test.c tests/usb-hcd-xhci-test.c+5 -490 replies
3/4libqtest: add qmp_device_add()tests/libqtest.c tests/libqtest.h+24 -01 reply
4/4tests: use qmp_device_add() where propertests/libqos/pci.c tests/libqos/usb.c tests/usb-hcd-uhci-test.c +1 more+12 -570 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/4] qtest: fix "device_del" out-of-order events

It starts from a "make check" failure on one of my private tree. The problem is that when we do "device_del" we normally looking for two
things: one response (which is mostly empty), and a REMOVE event. The tricky point is the event can either be there before/after the empty response. So I added qmp_device_del() to make sure the order does not matter, then use it where proper.

Since I'm at it, I also added the sister helper qmp_device_add(), it helps to remove LOCs.

I still don't 100% sure why my private tree can trigger this error, while the master cannot. Anyway, I think this is something we should have, no matter what.

Please review. Thanks.

Peter Xu (4):
libqtest: add qmp_device_del()
tests: use qmp_device_del() where proper
libqtest: add qmp_device_add()
tests: use qmp_device_add() where proper

 tests/libqos/pci.c        | 15 +++--------
 tests/libqos/usb.c        | 28 +++++----------------
 tests/libqtest.c          | 63 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/libqtest.h          | 17 +++++++++++++
 tests/usb-hcd-uhci-test.c | 28 +++------------------
 tests/usb-hcd-xhci-test.c | 52 ++++----------------------------------
 6 files changed, 97 insertions(+), 106 deletions(-)
Signature · 1 line
2.7.4