On 06/19/14 22:01, Eric Blake wrote: > On 06/19/2014 07:46 AM, Peter Krempa wrote: >> The image labels are stored in the virStorageSource struct. Convert the >> virDomainDiskDefGetSecurityLabelDef helper not to use the full disk def >> and move it appropriately. >> --- >> src/conf/domain_conf.c | 14 -------------- >> src/conf/domain_conf.h | 3 --- >> src/libvirt_private.syms | 2 +- >> src/qemu/qemu_domain.c | 2 +- >> src/security/security_dac.c | 4 ++-- >> src/security/security_selinux.c | 4 ++-- >> src/util/virstoragefile.c | 15 +++++++++++++++ >> src/util/virstoragefile.h | 4 ++++ >> 8 files changed, 25 insertions(+), 23 deletions(-) >> > >> +++ b/src/qemu/qemu_domain.c >> @@ -2413,7 +2413,7 @@ qemuDomainGetImageIds(virQEMUDriverConfigPtr cfg, >> vmlabel->label) >> virParseOwnershipIds(vmlabel->label, uid, gid); >> >> - if ((disklabel = virDomainDiskDefGetSecurityLabelDef(disk, "dac")) && >> + if ((disklabel = virStorageSourceGetSecurityLabelDef(disk->src, "dac")) && > > Unrelated to your patch, but why is this an open-coded string... > >> disklabel->label) >> virParseOwnershipIds(disklabel->label, uid, gid); >> } >> diff --git a/src/security/security_dac.c b/src/security/security_dac.c >> index 9d5c25b..28f033d 100644 >> --- a/src/security/security_dac.c >> +++ b/src/security/security_dac.c >> @@ -302,7 +302,7 @@ virSecurityDACSetSecurityFileLabel(virDomainDiskDefPtr disk, >> uid_t user; >> gid_t group; >> >> - disk_seclabel = virDomainDiskDefGetSecurityLabelDef(disk, >> + disk_seclabel = virStorageSourceGetSecurityLabelDef(disk->src, >> SECURITY_DAC_NAME); > > ...while this is SECURITY_DAC_NAME? Might be worth an independent cleanup. SECURITY_DAC_NAME is defined in src/security/security_dac.c and thus not available to use in the qemu_domain code. Should we export it in the header of the security driver? Peter
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list