From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeExv-0005xo-NY for qemu-devel@nongnu.org; Tue, 14 Oct 2014 23:09:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XeExp-0004hK-Hi for qemu-devel@nongnu.org; Tue, 14 Oct 2014 23:09:31 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49310 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeExp-0004gr-BM for qemu-devel@nongnu.org; Tue, 14 Oct 2014 23:09:25 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 15 Oct 2014 05:08:43 +0200 Message-Id: <1413342561-4754-10-git-send-email-afaerber@suse.de> In-Reply-To: <1413342561-4754-1-git-send-email-afaerber@suse.de> References: <1413342561-4754-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 09/47] tests: virtio-rng: Check if hot-plug/unplug works List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Igor Mammedov Signed-off-by: Igor Mammedov Reviewed-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Andreas F=C3=A4rber --- tests/Makefile | 2 +- tests/virtio-rng-test.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index ffa8312..49d6532 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -325,7 +325,7 @@ tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-= obj-y) tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o -tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o +tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-= y) tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c index 402c206..41c1cdb 100644 --- a/tests/virtio-rng-test.c +++ b/tests/virtio-rng-test.c @@ -11,18 +11,28 @@ #include #include "libqtest.h" #include "qemu/osdep.h" +#include "libqos/pci.h" + +#define PCI_SLOT_HP 0x06 =20 /* Tests only initialization so far. TODO: Replace with functional tests= */ static void pci_nop(void) { } =20 +static void hotplug(void) +{ + qpci_plug_device_test("virtio-rng-pci", "rng1", PCI_SLOT_HP, NULL); + qpci_unplug_acpi_device_test("rng1", PCI_SLOT_HP); +} + int main(int argc, char **argv) { int ret; =20 g_test_init(&argc, &argv, NULL); qtest_add_func("/virtio/rng/pci/nop", pci_nop); + qtest_add_func("/virtio/rng/pci/hotplug", hotplug); =20 qtest_start("-device virtio-rng-pci"); ret =3D g_test_run(); --=20 1.8.4.5