mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
security: apparmor: Use only virStorageSource for disk paths
This is closer to what security_selinux.c does, and will help add support for qcow2 external data_files Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
@@ -938,13 +938,13 @@ add_file_path(virStorageSourcePtr src,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
disk_add_files(virDomainDiskDefPtr disk,
|
storage_source_add_files(virStorageSourcePtr src,
|
||||||
virBufferPtr buf)
|
virBufferPtr buf)
|
||||||
{
|
{
|
||||||
size_t depth = 0;
|
size_t depth = 0;
|
||||||
virStorageSourcePtr tmp;
|
virStorageSourcePtr tmp;
|
||||||
|
|
||||||
for (tmp = disk->src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
|
for (tmp = src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
|
||||||
if (add_file_path(tmp, depth, buf) < 0)
|
if (add_file_path(tmp, depth, buf) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -994,7 +994,7 @@ get_files(vahControl * ctl)
|
|||||||
|
|
||||||
/* XXX should handle open errors more careful than just ignoring them.
|
/* XXX should handle open errors more careful than just ignoring them.
|
||||||
*/
|
*/
|
||||||
if (disk_add_files(disk, &buf) < 0)
|
if (storage_source_add_files(disk->src, &buf) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user