[Pkg-libvirt-commits] [libguestfs] 28/35: v2v: -o rhev: Use chown --reference instead of 36.36 (RHBZ#1143887).

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:46:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.49-1
in repository libguestfs.

commit 70444670acc60c5700bcd07ea7440d186eb4b60c
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu Sep 18 15:07:32 2014 +0100

    v2v: -o rhev: Use chown --reference instead of 36.36 (RHBZ#1143887).
    
    When chowning the final directories, instead of chowning them to 36.36
    (ie. hard-coding those UID/GIDs), use a --reference chown so it should
    take the ownership from the parent directory.
    
    Unfortunately chowning is very complex because of:
    
     - NFSv3 vs NFSv4
    
     - root squash
    
     - idmap
    
    which creates approximately 8 different ways for this to fail.
---
 v2v/output_rhev.ml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/v2v/output_rhev.ml b/v2v/output_rhev.ml
index f155357..75dc8cd 100644
--- a/v2v/output_rhev.ml
+++ b/v2v/output_rhev.ml
@@ -241,11 +241,13 @@ object
     close_out chan;
 
     (* Try to chown the images and metadata. *)
-    let cmd = sprintf "chown -R 36.36 %s %s" (quote dir) (quote image_dir) in
+    let cmd =
+      sprintf "chown -R --reference=%s %s %s"
+        (quote (esd_mp // esd_uuid)) (quote dir) (quote image_dir) in
     if verbose then eprintf "%s\n%!" cmd;
     if Sys.command cmd <> 0 then (
       (* Note: Don't print the mountpoint in the message below. *)
-      warning ~prog (f_"could not chown newly created RHEV files and directories to 36.36. You may need to do this by hand, otherwise RHEV-M may give errors when trying to import this domain.\n\nThe directories (and all files inside) that have to be owned by 36.36 are:\n%s\n%s")
+      warning ~prog (f_"could not chown newly created RHEV files and directories to vdsm.kvm.\n\nYou will need to do this operation by hand, otherwise RHEV-M will give errors when trying to import this domain.\n\nThe directories (and all files inside) that have to be owned by vdsm.kvm are:\n%s\n%s")
         (esd_uuid // "master" // "vms" // vm_uuid)
         (esd_uuid // "images" // image_uuid)
     );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list