security: Drop virSecurity(DAC|SELinux)SetImageLabelRelative()

The single caller for each function passes the same value
for @src and @parent, which means that we don't really need
the additional API.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Andrea Bolognani 2023-11-21 18:20:32 +01:00
parent 94028ebf48
commit 8ca0005ec6
2 changed files with 10 additions and 28 deletions

View File

@ -939,12 +939,12 @@ virSecurityDACSetImageLabelInternal(virSecurityManager *mgr,
static int
virSecurityDACSetImageLabelRelative(virSecurityManager *mgr,
virDomainDef *def,
virStorageSource *src,
virStorageSource *parent,
virSecurityDomainImageLabelFlags flags)
virSecurityDACSetImageLabel(virSecurityManager *mgr,
virDomainDef *def,
virStorageSource *src,
virSecurityDomainImageLabelFlags flags)
{
virStorageSource *parent = src;
virStorageSource *n;
for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
@ -962,15 +962,6 @@ virSecurityDACSetImageLabelRelative(virSecurityManager *mgr,
return 0;
}
static int
virSecurityDACSetImageLabel(virSecurityManager *mgr,
virDomainDef *def,
virStorageSource *src,
virSecurityDomainImageLabelFlags flags)
{
return virSecurityDACSetImageLabelRelative(mgr, def, src, src, flags);
}
static int
virSecurityDACRestoreImageLabelInt(virSecurityManager *mgr,
virDomainDef *def,

View File

@ -1980,12 +1980,12 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManager *mgr,
static int
virSecuritySELinuxSetImageLabelRelative(virSecurityManager *mgr,
virDomainDef *def,
virStorageSource *src,
virStorageSource *parent,
virSecurityDomainImageLabelFlags flags)
virSecuritySELinuxSetImageLabel(virSecurityManager *mgr,
virDomainDef *def,
virStorageSource *src,
virSecurityDomainImageLabelFlags flags)
{
virStorageSource *parent = src;
virStorageSource *n;
for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
@ -2004,15 +2004,6 @@ virSecuritySELinuxSetImageLabelRelative(virSecurityManager *mgr,
}
static int
virSecuritySELinuxSetImageLabel(virSecurityManager *mgr,
virDomainDef *def,
virStorageSource *src,
virSecurityDomainImageLabelFlags flags)
{
return virSecuritySELinuxSetImageLabelRelative(mgr, def, src, src, flags);
}
struct virSecuritySELinuxMoveImageMetadataData {
virSecurityManager *mgr;
const char *src;