[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 21/23] qmp: add command "x-oob-test"
From: |
Peter Xu |
Subject: |
[Qemu-devel] [PATCH v8 21/23] qmp: add command "x-oob-test" |
Date: |
Fri, 9 Mar 2018 17:00:04 +0800 |
This command is only used to test OOB functionality. It should not be
used for any other purposes.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
---
qapi/misc.json | 18 ++++++++++++++++++
qmp.c | 16 ++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/qapi/misc.json b/qapi/misc.json
index 8c7e736681..07932bdacf 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -3264,3 +3264,21 @@
##
{ 'event': 'COMMAND_DROPPED' ,
'data': { 'id': 'any', 'reason': 'CommandDropReason' } }
+
+##
+# @x-oob-test:
+#
+# Test OOB functionality. When send this command with lock=true,
+# it'll try to hang the dispatcher. When send it with lock=false,
+# it'll try to notify the locked thread to continue. Note: it should
+# only be used by QMP test program rather than anything else.
+#
+# Since: 2.12
+#
+# Example:
+#
+# { "execute": "x-oob-test",
+# "arguments": { "lock": true } }
+##
+{ 'command': 'x-oob-test', 'data' : { 'lock': 'bool' },
+ 'allow-oob': true }
diff --git a/qmp.c b/qmp.c
index 8c7d1cc479..d95d132448 100644
--- a/qmp.c
+++ b/qmp.c
@@ -770,3 +770,19 @@ MemoryInfo *qmp_query_memory_size_summary(Error **errp)
return mem_info;
}
+
+static QemuSemaphore x_oob_test_sem;
+
+static void __attribute__((constructor)) x_oob_test_init(void)
+{
+ qemu_sem_init(&x_oob_test_sem, 0);
+}
+
+void qmp_x_oob_test(bool lock, Error **errp)
+{
+ if (lock) {
+ qemu_sem_wait(&x_oob_test_sem);
+ } else {
+ qemu_sem_post(&x_oob_test_sem);
+ }
+}
--
2.14.3
- Re: [Qemu-devel] [PATCH v8 19/23] qmp: isolate responses into io thread, (continued)
[Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2018/03/09
- Re: [Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Christian Borntraeger, 2018/03/23
- Re: [Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2018/03/23
- Re: [Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Christian Borntraeger, 2018/03/23
- Re: [Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2018/03/23
- Re: [Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Peter Maydell, 2018/03/23
- Re: [Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Christian Borntraeger, 2018/03/23
- Re: [Qemu-devel] [PATCH v8 20/23] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2018/03/23
[Qemu-devel] [PATCH v8 21/23] qmp: add command "x-oob-test",
Peter Xu <=
[Qemu-devel] [PATCH v8 22/23] tests: qmp-test: verify command batching, Peter Xu, 2018/03/09
[Qemu-devel] [PATCH v8 23/23] tests: qmp-test: add oob test, Peter Xu, 2018/03/09
Re: [Qemu-devel] [PATCH v8 00/23] QMP: out-of-band (OOB) execution support, Eric Blake, 2018/03/10
Re: [Qemu-devel] [PATCH v8 00/23] QMP: out-of-band (OOB) execution support, Eric Blake, 2018/03/12