[libvirt] [PATCH v4 14/20] qemu: add vhost-user-gpu helper unit

Ján Tomko jtomko at redhat.com
Mon Sep 23 07:40:31 UTC 2019


On Fri, Sep 13, 2019 at 04:50:51PM +0400, marcandre.lureau at redhat.com wrote:
>From: Marc-André Lureau <marcandre.lureau at redhat.com>
>
>Similar to the qemu_tpm.c, add a unit with a few functions to
>start/stop and setup the cgroup of the external vhost-user-gpu
>process. See function documentation.
>
>The vhost-user connection fd is set on qemuDomainVideoPrivate struct.
>
>Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
>---
> src/qemu/Makefile.inc.am       |   2 +
> src/qemu/qemu_domain.c         |   5 +-
> src/qemu/qemu_domain.h         |   2 +-
> src/qemu/qemu_vhost_user_gpu.c | 276 +++++++++++++++++++++++++++++++++
> src/qemu/qemu_vhost_user_gpu.h |  49 ++++++
> 5 files changed, 332 insertions(+), 2 deletions(-)
> create mode 100644 src/qemu/qemu_vhost_user_gpu.c
> create mode 100644 src/qemu/qemu_vhost_user_gpu.h
>
>+/*
>+ * qemuExtVhostUserGPUSetupCgroup:
>+ *
>+ * @driver: QEMU driver
>+ * @def: domain definition
>+ * @video: the video device
>+ * @cgroupe: a cgroup
>+ *
>+ * Add the vhost-user-gpu PID to the given cgroup.
>+ */
>+int
>+qemuExtVhostUserGPUSetupCgroup(virQEMUDriverPtr driver,
>+                               virDomainDefPtr def,
>+                               virDomainVideoDefPtr video,
>+                               virCgroupPtr cgroup)
>+{
>+    VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
>+    VIR_AUTOFREE(char *) pidfile = NULL;

Clang fails to compile this:

qemu/qemu_vhost_user_gpu.c:256:26: error: unused variable 'pidfile' [-Werror,-Wunused-variable]
    VIR_AUTOFREE(char *) pidfile = NULL;
                         ^
1 error generated.

>+    VIR_AUTOFREE(char *) shortname = NULL;
>+    int rc;
>+    pid_t pid;
>+

Jano
-------------- 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/20190923/66cc2c0b/attachment-0001.sig>


More information about the libvir-list mailing list