}
-static int
+static int G_GNUC_UNUSED
qemuDomainCreateDevice(const char *device,
const struct qemuDomainCreateDeviceData *data,
bool allow_noent)
static int
qemuDomainSetupLaunchSecurity(virDomainObjPtr vm,
- const struct qemuDomainCreateDeviceData *data)
+ char ***paths)
{
virDomainSEVDefPtr sev = vm->def->sev;
VIR_DEBUG("Setting up launch security");
- if (qemuDomainCreateDevice(QEMU_DEV_SEV, data, false) < 0)
+ if (virStringListAdd(paths, QEMU_DEV_SEV) < 0)
return -1;
VIR_DEBUG("Set up launch security");
if (qemuDomainSetupLoader(vm, &paths) < 0)
return -1;
+ if (qemuDomainSetupLaunchSecurity(vm, &paths) < 0)
+ return -1;
+
if (qemuNamespaceMknodPaths(vm, (const char **) paths) < 0)
return -1;
virSecurityManagerPtr mgr,
virDomainObjPtr vm)
{
- struct qemuDomainCreateDeviceData data;
const char *devPath = NULL;
char **devMountsPath = NULL, **devMountsSavePath = NULL;
size_t ndevMountsPath = 0, i;
goto cleanup;
}
- data.path = devPath;
- data.devMountsPath = devMountsPath;
- data.ndevMountsPath = ndevMountsPath;
-
if (virProcessSetupPrivateMountNS() < 0)
goto cleanup;
if (qemuDomainSetupDev(mgr, vm, devPath) < 0)
goto cleanup;
- if (qemuDomainSetupLaunchSecurity(vm, &data) < 0)
- goto cleanup;
-
/* Save some mount points because we want to share them with the host */
for (i = 0; i < ndevMountsPath; i++) {
struct stat sb;