From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ds45p-00011i-OU for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:36:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ds45m-0007TK-J9 for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:36:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46906) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ds45m-0007St-Dx for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:36:22 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 811047F755 for ; Wed, 13 Sep 2017 09:36:21 +0000 (UTC) From: Peter Xu Date: Wed, 13 Sep 2017 17:36:02 +0800 Message-Id: <1505295366-25295-1-git-send-email-peterx@redhat.com> Subject: [Qemu-devel] [PATCH 0/4] qtest: fix "device_del" out-of-order events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eric Blake , Markus Armbruster , Fam Zheng , Gerd Hoffmann , peterx@redhat.com 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(-) -- 2.7.4