[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 15/50] tests/device-plug: Add CCW unplug test for s390x
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 15/50] tests/device-plug: Add CCW unplug test for s390x |
Date: |
Tue, 26 Feb 2019 15:52:29 +1100 |
From: David Hildenbrand <address@hidden>
As CCW unplugs are surprise removals without asking the guest first,
we can test this without any guest interaction.
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Acked-by: Cornelia Huck <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
tests/device-plug-test.c | 41 +++++++++++++++++++++++++++++++++++-----
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/tests/device-plug-test.c b/tests/device-plug-test.c
index cd9ada539d..d1a6c94af2 100644
--- a/tests/device-plug-test.c
+++ b/tests/device-plug-test.c
@@ -15,17 +15,26 @@
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
-static void device_del_request(QTestState *qtest, const char *id)
+static void device_del_start(QTestState *qtest, const char *id)
{
- QDict *resp;
+ qtest_qmp_send(qtest,
+ "{'execute': 'device_del', 'arguments': { 'id': %s } }",
id);
+}
+
+static void device_del_finish(QTestState *qtest)
+{
+ QDict *resp = qtest_qmp_receive(qtest);
- resp = qtest_qmp(qtest,
- "{'execute': 'device_del', 'arguments': { 'id': %s } }",
- id);
g_assert(qdict_haskey(resp, "return"));
qobject_unref(resp);
}
+static void device_del_request(QTestState *qtest, const char *id)
+{
+ device_del_start(qtest, id);
+ device_del_finish(qtest);
+}
+
static void system_reset(QTestState *qtest)
{
QDict *resp;
@@ -77,8 +86,25 @@ static void test_pci_unplug_request(void)
qtest_quit(qtest);
}
+static void test_ccw_unplug(void)
+{
+ QTestState *qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");
+
+ /*
+ * The DEVICE_DELETED events will be sent before the command
+ * completes.
+ */
+ device_del_start(qtest, "dev0");
+ wait_device_deleted_event(qtest, "dev0");
+ device_del_finish(qtest);
+
+ qtest_quit(qtest);
+}
+
int main(int argc, char **argv)
{
+ const char *arch = qtest_get_arch();
+
g_test_init(&argc, &argv, NULL);
/*
@@ -89,5 +115,10 @@ int main(int argc, char **argv)
qtest_add_func("/device-plug/pci-unplug-request",
test_pci_unplug_request);
+ if (!strcmp(arch, "s390x")) {
+ qtest_add_func("/device-plug/ccw-unplug",
+ test_ccw_unplug);
+ }
+
return g_test_run();
}
--
2.20.1
- [Qemu-ppc] [PULL 08/50] target/ppc: Add Hypervisor Virtualization Interrupt on POWER9, (continued)
- [Qemu-ppc] [PULL 08/50] target/ppc: Add Hypervisor Virtualization Interrupt on POWER9, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 09/50] target/ppc: Add POWER9 external interrupt model, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 21/50] target/ppc: Fix #include guard in mmu-book3s-v3.h, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 20/50] target/ppc: Re-enable RMLS on POWER9 for virtual hypervisors, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 07/50] target/ppc: Detect erroneous condition in interrupt delivery, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 19/50] target/ppc/mmu: Use LPCR:HR to chose radix vs. hash translation, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 18/50] target/ppc/spapr: Set LPCR:HR when using Radix mode, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 31/50] spapr: Generate FDT fragment for CPUs at configure connector time, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 06/50] target/ppc: Add POWER9 exception model, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 12/50] cpus: Properly release the iothread lock when killing a dummy VCPU, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 15/50] tests/device-plug: Add CCW unplug test for s390x,
David Gibson <=
- [Qemu-ppc] [PULL 17/50] tests/device-plug: Add memory unplug request test for spapr, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 16/50] tests/device-plug: Add CPU core unplug request test for spapr, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 24/50] target/ppc: Fix synchronization of mttcg with broadcast TLB flushes, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 26/50] target/ppc: Rename PATB/PATBE -> PATE, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 14/50] tests/device-plug: Add a simple PCI unplug request test, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 25/50] target/ppc: Flush the TLB locally when the LPIDR is written, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 23/50] target/ppc: Add basic support for "new format" HPTE as found on POWER9, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 22/50] target/ppc: Fix ordering of hash MMU accesses, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 28/50] target/ppc: Basic POWER9 bare-metal radix MMU support, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 35/50] spapr: Expose the name of the interrupt controller node, David Gibson, 2019/02/25