[libvirt] [PATCH] Don't reset user/group/security label on shared filesystems during migrate

Eric Blake eblake at redhat.com
Thu May 13 16:37:19 UTC 2010


On 05/13/2010 09:52 AM, Daniel P. Berrange wrote:
> When QEMU runs with its disk on NFS, and as a non-root user, the
> disk is chownd to that non-root user. When migration completes
> the last step is shutting down the QEMU on the source host. THis
> normally resets user/group/security label. This is bad when the
> VM was just migrated because the file is still in use on the dest
> host. It is thus neccessary to skip the reset step for any files
> found to be on a shared filesystem
> 
> * src/libvirt_private.syms: Export virStorageFileIsSharedFS
> * src/util/storage_file.c, src/util/storage_file.h: Add a new
>   method virStorageFileIsSharedFS() to determine if a file is
>   on a shared filesystem (NFS, GFS, OCFS2, etc)

Is this sufficient?  Suppose I have the situation where on hypervisor A,
the disk image is on a local drive, but that machine A also exports that
directory via NFS.  Then on hypervisor B, the disk image is viewed via
NFS.  When migrating a guest from machine A to B, the shutdown path on
machine A will see that the file is on local storage, not NFS, and will
not get your code exemption that avoids the relabel.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100513/e351b714/attachment-0001.sig>


More information about the libvir-list mailing list