On 07/04/2014 05:29 AM, Peter Krempa wrote: > Refactor the existing code to allow re-using it for the per-image label > restore too. > --- > src/security/security_selinux.c | 59 ++++++++++++++++++++++++----------------- > 1 file changed, 34 insertions(+), 25 deletions(-) > > @@ -1144,40 +1146,35 @@ virSecuritySELinuxRestoreSecurityImageLabelInt(virSecurityManagerPtr mgr, > * be tracked in domain XML, at which point labelskip should be a > * per-file attribute instead of a disk attribute. */ > if (disk_seclabel && disk_seclabel->labelskip && Oh, we are SOOO close to getting labelskip to be a per-image attribute. :) > + /* Don't restore labels on readoly/shared disks, because other VMs may > + * still be accessing these Alternatively we could iterate over all running While touching this, s/these/these./ > + * domains and try to figure out if it is in use, but this would not work > + * for clustered filesystems, since we can't see running VMs using the file > + * on other nodes Safest bet is thus to skip the restore step. s/nodes/nodes./ [actually, it's probably better to integrate this into the lease manager, or similar solution, where we also track WHAT label to restore rather than just slamming a default label on - but that's been a pervasive problem that you don't need to solve here] > - /* If we have a shared FS & doing migrated, we must not > - * change ownership, because that kills access on the > - * destination host which is sub-optimal for the guest > - * VM's I/O attempts :-) > + /* If we have a shared FS & doing migrated, we must not change ownership, While touching this, s/doing migrated/are doing migration/ ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list