[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 04/36] test: virtio-rng: check if hot-plug/unplug
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH v2 04/36] test: virtio-rng: check if hot-plug/unplug works |
Date: |
Fri, 26 Sep 2014 09:28:09 +0000 |
Signed-off-by: Igor Mammedov <address@hidden>
---
v2:
moved code duplication into library
---
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 f5de29c..e72c78c 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 <string.h>
#include "libqtest.h"
#include "qemu/osdep.h"
+#include "libqos/pci.h"
+
+#define PCI_SLOT_HP 0x06
/* Tests only initialization so far. TODO: Replace with functional tests */
static void pci_nop(void)
{
}
+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;
g_test_init(&argc, &argv, NULL);
qtest_add_func("/virtio/rng/pci/nop", pci_nop);
+ qtest_add_func("/virtio/rng/pci/hotplug", hotplug);
qtest_start("-device virtio-rng-pci");
ret = g_test_run();
--
1.8.3.1
- [Qemu-devel] [PATCH v2 00/36] complete conversion to hotplug-handler API, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 01/36] test: virtio-scsi: check if hot-plug/unplug works, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 02/36] test: virtio-serial: check if hot-plug/unplug works, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 03/36] test: libqos: add qpci_plug_device_test() and qpci_unplug_acpi_device_test(), Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 04/36] test: virtio-rng: check if hot-plug/unplug works,
Igor Mammedov <=
- [Qemu-devel] [PATCH v2 05/36] test: virtio-net: check if hot-plug/unplug works, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 06/36] test: virtio-blk: check if hot-plug/unplug works, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 07/36] test: usb: move uhci port test code to libqos/usb.c, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 08/36] test: usb: add port test to uhci unit test, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 09/36] test: usb: generic usb device hotplug, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 10/36] test: usb: usb-storage hotplug test, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 12/36] access BusState.allow_hotplug using wraper qbus_is_hotpluggable(), Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 13/36] qdev: do not allow to instantiate non hotpluggable device with device_add, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 14/36] qdev: HotplugHandler: rename unplug callback to unplug_request, Igor Mammedov, 2014/09/26