In near future it will be necessary to know the PID of
vhost-user-gpu process for QEMU. Export the function that does
just that (qemuVhostUserGPUGetPid()).
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_vhost_user_gpu.c | 2 +-
src/qemu/qemu_vhost_user_gpu.h | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_vhost_user_gpu.c b/src/qemu/qemu_vhost_user_gpu.c
index 7c5be4098e..c8956835b0 100644
--- a/src/qemu/qemu_vhost_user_gpu.c
+++ b/src/qemu/qemu_vhost_user_gpu.c
@@ -60,7 +60,7 @@ qemuVhostUserGPUCreatePidFilename(const char *stateDir,
* If the PID was not still alive, zero will be returned, and @pid will be
* set to -1;
*/
-static int
+int
qemuVhostUserGPUGetPid(const char *stateDir,
const char *shortName,
const char *alias,
diff --git a/src/qemu/qemu_vhost_user_gpu.h b/src/qemu/qemu_vhost_user_gpu.h
index 2b86982cb8..ffbb844437 100644
--- a/src/qemu/qemu_vhost_user_gpu.h
+++ b/src/qemu/qemu_vhost_user_gpu.h
@@ -39,6 +39,14 @@ void qemuExtVhostUserGPUStop(virQEMUDriver *driver,
virDomainVideoDef *video)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+int
+qemuVhostUserGPUGetPid(const char *stateDir,
+ const char *shortName,
+ const char *alias,
+ pid_t *pid)
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+ G_GNUC_WARN_UNUSED_RESULT;
+
int
qemuExtVhostUserGPUSetupCgroup(virQEMUDriver *driver,
virDomainDef *def,
--
2.35.1