[libvirt PATCH 07/11] qemu: start/stop an event thread for QMP probing
Ján Tomko
jtomko at redhat.com
Fri Feb 14 13:03:59 UTC 2020
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 at 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:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200214/61ec34fa/attachment-0001.sig>
More information about the libvir-list
mailing list