mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
src: fix generation of default resource partition
Now that resource structure can have appid as well we need to adapt code
that creates default resource partition if not provided by user.
Otherwise starting a VM with appid defined would fail with following
error:
error: unsupported configuration: Resource partition '(null)' must start with '/'
Fixes: 38b5f4faab
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
cb6c650064
commit
3796e8e1ff
@ -1258,13 +1258,11 @@ int virLXCProcessStart(virConnectPtr conn,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!vm->def->resource) {
|
||||
virDomainResourceDef *res = g_new0(virDomainResourceDef, 1);
|
||||
if (!vm->def->resource)
|
||||
vm->def->resource = g_new0(virDomainResourceDef, 1);
|
||||
|
||||
res->partition = g_strdup("/machine");
|
||||
|
||||
vm->def->resource = res;
|
||||
}
|
||||
if (!vm->def->resource->partition)
|
||||
vm->def->resource->partition = g_strdup("/machine");
|
||||
|
||||
logfile = g_strdup_printf("%s/%s.log", cfg->logDir, vm->def->name);
|
||||
|
||||
|
@ -949,15 +949,11 @@ qemuInitCgroup(virDomainObj *vm,
|
||||
virCgroupFree(priv->cgroup);
|
||||
priv->cgroup = NULL;
|
||||
|
||||
if (!vm->def->resource) {
|
||||
virDomainResourceDef *res;
|
||||
if (!vm->def->resource)
|
||||
vm->def->resource = g_new0(virDomainResourceDef, 1);
|
||||
|
||||
res = g_new0(virDomainResourceDef, 1);
|
||||
|
||||
res->partition = g_strdup("/machine");
|
||||
|
||||
vm->def->resource = res;
|
||||
}
|
||||
if (!vm->def->resource->partition)
|
||||
vm->def->resource->partition = g_strdup("/machine");
|
||||
|
||||
if (!g_path_is_absolute(vm->def->resource->partition)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
|
Loading…
Reference in New Issue
Block a user