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

Daniel P. Berrange berrange at redhat.com
Mon May 17 12:10:27 UTC 2010


On Mon, May 17, 2010 at 02:18:39AM -0400, Laine Stump wrote:
> On 05/13/2010 11:52 AM, Daniel P. Berrange wrote:
> [...]
> >@@ -11093,7 +11095,9 @@ qemudDomainMigratePerform (virDomainPtr dom,
> >      }
> >
> >      /* Clean up the source domain. */
> >-    qemudShutdownVMDaemon(driver, vm);
> >+    fprintf(stderr, "******************* MIG \n");
> >+    qemudShutdownVMDaemon(driver, vm, 1);
> >+    fprintf(stderr, "******************* YEEHAAA\n");
> >      resume = 0;
> >   
> 
> Ahem.

I pushed a fix for this.

> >+int virStorageFileIsSharedFS(const char *path)
> >+{
> >+    struct statfs sb;
> >+
> >+    if (statfs(path,&sb)<  0) {
> >+        virReportSystemError(errno,
> >+                             _("cannot determine filesystem for '%s'"),
> >+                             path);
> >+        return -1;
> >+    }
> >   
> 
> So I'm guessing in this use case, the destination directory will always 
> be stat-able by root? (makes sense, since otherwise you're implying 
> root-squash, and in that case you wouldn't be able to chown the file 
> anyway) (If it isn't always stat-able, you'd have to do the trick of 
> iteratively cropping off the last element of the path and retrying, 
> until you found the local mount point, which is always stat-able by 
> root, and will return the proper FS magic)

If you are doing migration on a root squashing NFS server, you need to
set the 'dynamic_ownership' setting to 0 in qemu.conf. At that point
this new code is never executed so its safe


Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list