mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
qemu_namespace: Introduce qemuDomainNamespaceSetupPath()
Sometimes it may come handy to just bind mount a directory/file into domain's namespace. Implement a thin wrapper over qemuNamespaceMknodPaths() which has all the logic we need. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
46b03819ae
commit
5853d70718
@ -1424,6 +1424,25 @@ qemuNamespaceUnlinkPaths(virDomainObj *vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
qemuDomainNamespaceSetupPath(virDomainObj *vm,
|
||||||
|
const char *path,
|
||||||
|
bool *created)
|
||||||
|
{
|
||||||
|
g_autoptr(virGSListString) paths = NULL;
|
||||||
|
|
||||||
|
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
paths = g_slist_prepend(paths, g_strdup(path));
|
||||||
|
|
||||||
|
if (qemuNamespaceMknodPaths(vm, paths, created) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
qemuDomainNamespaceSetupDisk(virDomainObj *vm,
|
qemuDomainNamespaceSetupDisk(virDomainObj *vm,
|
||||||
virStorageSource *src,
|
virStorageSource *src,
|
||||||
|
@ -48,6 +48,10 @@ void qemuDomainDestroyNamespace(virQEMUDriver *driver,
|
|||||||
|
|
||||||
bool qemuDomainNamespaceAvailable(qemuDomainNamespace ns);
|
bool qemuDomainNamespaceAvailable(qemuDomainNamespace ns);
|
||||||
|
|
||||||
|
int qemuDomainNamespaceSetupPath(virDomainObj *vm,
|
||||||
|
const char *path,
|
||||||
|
bool *created);
|
||||||
|
|
||||||
int qemuDomainNamespaceSetupDisk(virDomainObj *vm,
|
int qemuDomainNamespaceSetupDisk(virDomainObj *vm,
|
||||||
virStorageSource *src,
|
virStorageSource *src,
|
||||||
bool *created);
|
bool *created);
|
||||||
|
Loading…
Reference in New Issue
Block a user