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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 13, 2019 at 04:50:51PM +0400, marcandre.lureau@xxxxxxxxxx wrote:
From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

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@xxxxxxxxxx>
---
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

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux