qemu: virtiofs: do not force UID 0

Remove the explicit setting of uid 0 when running virtiofsd.

It is not required for privileged mode, where virtiofsd will be run
as root anyway. And for unprivileged mode, virtiofsd no longer requires
to be run as root.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2023-09-07 16:22:43 +02:00
parent bdf96a0f72
commit d27b6e5f49

View File

@ -257,10 +257,6 @@ qemuVirtioFSStart(virQEMUDriver *driver,
if (!(cmd = qemuVirtioFSBuildCommandLine(cfg, fs, &fd))) if (!(cmd = qemuVirtioFSBuildCommandLine(cfg, fs, &fd)))
goto error; goto error;
/* so far only running as root is supported */
virCommandSetUID(cmd, 0);
virCommandSetGID(cmd, 0);
virCommandSetPidFile(cmd, pidfile); virCommandSetPidFile(cmd, pidfile);
virCommandSetOutputFD(cmd, &logfd); virCommandSetOutputFD(cmd, &logfd);
virCommandSetErrorFD(cmd, &logfd); virCommandSetErrorFD(cmd, &logfd);