On Fri, Feb 14, 2020 at 12:52:05PM +0000, Daniel P. Berrangé wrote:
In common with regular QEMU guests, the QMP probing
will need an event loop for handling monitor I/O
operations.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_process.c | 16 ++++++++++++++++
src/qemu/qemu_process.h | 2 ++
2 files changed, 18 insertions(+)
@@ -8408,6 +8411,9 @@ qemuProcessQMPNew(const char *binary,
{
qemuProcessQMPPtr ret = NULL;
qemuProcessQMPPtr proc = NULL;
+ g_autoptr(GError) gerr = NULL;
Fails to build with Clang:
../../src/qemu/qemu_process.c:8416:23: error: unused variable 'gerr'
[-Werror,-Wunused-variable]
g_autoptr(GError) gerr = NULL;
^
1 error generated.
Jano
+ const char *threadSuffix;
+ g_autofree char *threadName = NULL;
VIR_DEBUG("exec=%s, libDir=%s, runUid=%u, runGid=%u, forceTCG=%d",
binary, libDir, runUid, runGid, forceTCG);
@@ -8422,6 +8428,16 @@ qemuProcessQMPNew(const char *binary,
proc->runGid = runGid;
proc->forceTCG = forceTCG;
+ threadSuffix = strrchr(binary, '-');
+ if (threadSuffix)
+ threadSuffix++;
+ else
+ threadSuffix = binary;
+ threadName = g_strdup_printf("qmp-%s", threadSuffix);
+
+ if (!(proc->eventThread = virEventThreadNew(threadName)))
+ goto cleanup;
+
ret = g_steal_pointer(&proc);
cleanup: