mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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 <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
ae373781a4
commit
55c3e969cf
@ -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:
|
* qemuSecurityStartTPMEmulator:
|
||||||
*
|
*
|
||||||
|
@ -87,12 +87,6 @@ int qemuSecurityRestoreNetdevLabel(virQEMUDriver *driver,
|
|||||||
virDomainObj *vm,
|
virDomainObj *vm,
|
||||||
virDomainNetDef *net);
|
virDomainNetDef *net);
|
||||||
|
|
||||||
int qemuSecurityStartVhostUserGPU(virQEMUDriver *driver,
|
|
||||||
virDomainObj *vm,
|
|
||||||
virCommand *cmd,
|
|
||||||
int *exitstatus,
|
|
||||||
int *cmdret);
|
|
||||||
|
|
||||||
int qemuSecurityStartTPMEmulator(virQEMUDriver *driver,
|
int qemuSecurityStartTPMEmulator(virQEMUDriver *driver,
|
||||||
virDomainObj *vm,
|
virDomainObj *vm,
|
||||||
virCommand *cmd,
|
virCommand *cmd,
|
||||||
|
@ -158,8 +158,7 @@ int qemuExtVhostUserGPUStart(virQEMUDriver *driver,
|
|||||||
virCommandAddArgFormat(cmd, "--render-node=%s", video->accel->rendernode);
|
virCommandAddArgFormat(cmd, "--render-node=%s", video->accel->rendernode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuSecurityStartVhostUserGPU(driver, vm, cmd,
|
if (qemuSecurityCommandRun(driver, vm, cmd, -1, -1, &exitstatus, &cmdret) < 0)
|
||||||
&exitstatus, &cmdret) < 0)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (cmdret < 0 || exitstatus != 0) {
|
if (cmdret < 0 || exitstatus != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user