goto error;
if (virAsprintf(&cfg->autostartDir, "%s/qemu/autostart", cfg->configBaseDir) < 0)
goto error;
+ if (virAsprintf(&cfg->slirpStateDir, "%s/slirp", cfg->stateDir) < 0)
+ goto error;
/* Set the default directory to find TLS X.509 certificates.
* This will then be used as a fallback if the service specific
VIR_FREE(cfg->swtpmLogDir);
VIR_FREE(cfg->stateDir);
VIR_FREE(cfg->swtpmStateDir);
+ VIR_FREE(cfg->slirpStateDir);
VIR_FREE(cfg->libDir);
VIR_FREE(cfg->cacheDir);
cfg->memoryBackingDir);
goto error;
}
+ if (virFileMakePath(cfg->slirpStateDir) < 0) {
+ virReportSystemError(errno, _("Failed to create slirp state dir %s"),
+ cfg->slirpStateDir);
+ goto error;
+ }
if ((qemu_driver->lockFD =
virPidFileAcquire(cfg->stateDir, "driver", false, getpid())) < 0)
(int)cfg->group);
goto error;
}
+ if (chown(cfg->slirpStateDir, cfg->user, cfg->group) < 0) {
+ virReportSystemError(errno,
+ _("unable to set ownership of '%s' to %d:%d"),
+ cfg->slirpStateDir, (int)cfg->user,
+ (int)cfg->group);
+ goto error;
+ }
run_uid = cfg->user;
run_gid = cfg->group;