qemu: put data-file path to VM's cgroup and namespace

Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Nikolai Barybin 2024-11-20 18:48:46 +03:00 committed by Peter Krempa
parent 702f8b5a77
commit 9ba2bef816
2 changed files with 16 additions and 1 deletions

View File

@ -232,7 +232,14 @@ int
qemuSetupImageCgroup(virDomainObj *vm, qemuSetupImageCgroup(virDomainObj *vm,
virStorageSource *src) virStorageSource *src)
{ {
return qemuSetupImageCgroupInternal(vm, src, false); if (qemuSetupImageCgroupInternal(vm, src, false) < 0)
return -1;
if (src->dataFileStore &&
qemuSetupImageCgroupInternal(vm, src->dataFileStore, false) < 0)
return -1;
return 0;
} }
@ -321,6 +328,10 @@ qemuSetupImageChainCgroup(virDomainObj *vm,
if (qemuSetupImageCgroupInternal(vm, next, forceReadonly) < 0) if (qemuSetupImageCgroupInternal(vm, next, forceReadonly) < 0)
return -1; return -1;
if (next->dataFileStore &&
qemuSetupImageCgroupInternal(vm, next->dataFileStore, forceReadonly) < 0)
return -1;
/* setup only the top level image for read-write */ /* setup only the top level image for read-write */
forceReadonly = true; forceReadonly = true;
} }

View File

@ -272,6 +272,10 @@ qemuDomainSetupDisk(virStorageSource *src,
} else { } else {
GSList *targetPaths = NULL; GSList *targetPaths = NULL;
if (next->dataFileStore &&
virStorageSourceIsLocalStorage(next->dataFileStore))
*paths = g_slist_prepend(*paths, g_strdup(next->dataFileStore->path));
if (virStorageSourceIsEmpty(next) || if (virStorageSourceIsEmpty(next) ||
!virStorageSourceIsLocalStorage(next)) { !virStorageSourceIsLocalStorage(next)) {
/* Not creating device. Just continue. */ /* Not creating device. Just continue. */