From: Michal Privoznik Date: Thu, 28 Apr 2022 11:19:11 +0000 (+0200) Subject: qemu_security: Drop qemuSecurityStartVhostUserGPU() X-Git-Tag: v8.4.0-rc1~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55c3e969cf70652acd98f72e20538cdc6ed5e64d;p=thirdparty%2Flibvirt.git qemu_security: Drop qemuSecurityStartVhostUserGPU() There's no real difference between qemuSecurityStartVhostUserGPU() and qemuSecurityCommandRun(). The latter is used more frequently while the former has just one user. Therefore, drop the less frequently used one. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_security.c b/src/qemu/qemu_security.c index 19d957dd4b..3be1766764 100644 --- a/src/qemu/qemu_security.c +++ b/src/qemu/qemu_security.c @@ -499,46 +499,6 @@ qemuSecurityRestoreNetdevLabel(virQEMUDriver *driver, } -/* - * qemuSecurityStartVhostUserGPU: - * - * @driver: the QEMU driver - * @vm: the domain object - * @cmd: the command to run - * @existstatus: pointer to int returning exit status of process - * @cmdret: pointer to int returning result of virCommandRun - * - * Start the vhost-user-gpu process with appropriate labels. - * This function returns -1 on security setup error, 0 if all the - * setup was done properly. In case the virCommand failed to run - * 0 is returned but cmdret is set appropriately with the process - * exitstatus also set. - */ -int -qemuSecurityStartVhostUserGPU(virQEMUDriver *driver, - virDomainObj *vm, - virCommand *cmd, - int *exitstatus, - int *cmdret) -{ - if (virSecurityManagerSetChildProcessLabel(driver->securityManager, - vm->def, cmd) < 0) - return -1; - - if (virSecurityManagerPreFork(driver->securityManager) < 0) - return -1; - - *cmdret = virCommandRun(cmd, exitstatus); - - virSecurityManagerPostFork(driver->securityManager); - - if (*cmdret < 0) - return -1; - - return 0; -} - - /* * qemuSecurityStartTPMEmulator: * diff --git a/src/qemu/qemu_security.h b/src/qemu/qemu_security.h index 8b26ea3f99..eaf646f225 100644 --- a/src/qemu/qemu_security.h +++ b/src/qemu/qemu_security.h @@ -87,12 +87,6 @@ int qemuSecurityRestoreNetdevLabel(virQEMUDriver *driver, virDomainObj *vm, virDomainNetDef *net); -int qemuSecurityStartVhostUserGPU(virQEMUDriver *driver, - virDomainObj *vm, - virCommand *cmd, - int *exitstatus, - int *cmdret); - int qemuSecurityStartTPMEmulator(virQEMUDriver *driver, virDomainObj *vm, virCommand *cmd, diff --git a/src/qemu/qemu_vhost_user_gpu.c b/src/qemu/qemu_vhost_user_gpu.c index f7d444e851..6f601cebde 100644 --- a/src/qemu/qemu_vhost_user_gpu.c +++ b/src/qemu/qemu_vhost_user_gpu.c @@ -158,8 +158,7 @@ int qemuExtVhostUserGPUStart(virQEMUDriver *driver, virCommandAddArgFormat(cmd, "--render-node=%s", video->accel->rendernode); } - if (qemuSecurityStartVhostUserGPU(driver, vm, cmd, - &exitstatus, &cmdret) < 0) + if (qemuSecurityCommandRun(driver, vm, cmd, -1, -1, &exitstatus, &cmdret) < 0) goto error; if (cmdret < 0 || exitstatus != 0) {