diff options
author | Peter Xu <peterx@redhat.com> | 2018-03-09 17:00:04 +0800 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2018-03-19 14:58:37 -0500 |
commit | 469638f9cb3fde767fbc207f62fc3735eea96ef1 (patch) | |
tree | 509c1e7a3f52a5b41255032560fc7f7dee3b4182 /qmp.c | |
parent | 3fd2457d18edf5736f713dfe1ada9c87a9badab1 (diff) |
qmp: add command "x-oob-test"
This command is only used to test OOB functionality. It should not be
used for any other purposes.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180309090006.10018-22-peterx@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweak]
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r-- | qmp.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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); + } +} |