[Pkg-libvirt-commits] [libguestfs] 172/233: sysprep: Deprecate --selinux-relabel in favour of --autorelabel.

Hilko Bengen bengen at moszumanska.debian.org
Wed Feb 19 21:12:05 UTC 2014


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

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 49014f81f350484da725f5ee2bc62bb24268a334
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Jan 29 14:50:55 2014 +0000

    sysprep: Deprecate --selinux-relabel in favour of --autorelabel.
    
    virt-builder added a --selinux-relabel option with a slightly
    different meaning.
    
    This commit keeps the old --selinux-relabel / --no-selinux-relabel
    options in virt-sysprep, but deprecates them and replaces them with
    --autorelabel and --no-autorelabel.
---
 sysprep/main.ml          | 24 +++++++++++++-----------
 sysprep/virt-sysprep.pod | 24 ++++++++++++------------
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/sysprep/main.ml b/sysprep/main.ml
index 9431e88..6f631d5 100644
--- a/sysprep/main.ml
+++ b/sysprep/main.ml
@@ -33,7 +33,7 @@ let prog = Filename.basename Sys.executable_name
 
 let () = Random.self_init ()
 
-let debug_gc, operations, g, selinux_relabel, quiet, mount_opts =
+let debug_gc, operations, g, autorelabel, quiet, mount_opts =
   let debug_gc = ref false in
   let domain = ref None in
   let dryrun = ref false in
@@ -42,7 +42,7 @@ let debug_gc, operations, g, selinux_relabel, quiet, mount_opts =
   let quiet = ref false in
   let libvirturi = ref "" in
   let operations = ref None in
-  let selinux_relabel = ref `Auto in
+  let autorelabel = ref `Auto in
   let trace = ref false in
   let verbose = ref false in
   let mount_opts = ref "" in
@@ -123,10 +123,10 @@ let debug_gc, operations, g, selinux_relabel, quiet, mount_opts =
             exit 1
     ) currentopset ops in
     operations := Some opset
-  and force_selinux_relabel () =
-    selinux_relabel := `Force
-  and no_force_selinux_relabel () =
-    selinux_relabel := `Never
+  and force_autorelabel () =
+    autorelabel := `Force
+  and no_force_autorelabel () =
+    autorelabel := `Never
   and list_operations () =
     Sysprep_operation.list_operations ();
     exit 0
@@ -135,6 +135,8 @@ let debug_gc, operations, g, selinux_relabel, quiet, mount_opts =
   let basic_args = [
     "-a",        Arg.String add_file,       s_"file" ^ " " ^ s_"Add disk image file";
     "--add",     Arg.String add_file,       s_"file" ^ " " ^ s_"Add disk image file";
+    "--autorelabel", Arg.Unit force_autorelabel, " " ^ s_"Force SELinux relabel";
+    "--no-autorelabel", Arg.Unit no_force_autorelabel, " " ^ s_"Never do SELinux relabel";
     "-c",        Arg.Set_string libvirturi, s_"uri" ^ " " ^ s_"Set libvirt URI";
     "--connect", Arg.Set_string libvirturi, s_"uri" ^ " " ^ s_"Set libvirt URI";
     "--debug-gc", Arg.Set debug_gc,         " " ^ s_"Debug GC and memory allocations (internal)";
@@ -154,8 +156,8 @@ let debug_gc, operations, g, selinux_relabel, quiet, mount_opts =
     "--operations", Arg.String set_operations, " " ^ s_"Enable/disable specific operations";
     "-q",        Arg.Set quiet,             " " ^ s_"Don't print log messages";
     "--quiet",   Arg.Set quiet,             " " ^ s_"Don't print log messages";
-    "--selinux-relabel", Arg.Unit force_selinux_relabel, " " ^ s_"Force SELinux relabel";
-    "--no-selinux-relabel", Arg.Unit no_force_selinux_relabel, " " ^ s_"Never do SELinux relabel";
+    "--selinux-relabel", Arg.Unit force_autorelabel, " " ^ s_"Use --autorelabel";
+    "--no-selinux-relabel", Arg.Unit no_force_autorelabel, " " ^ s_"Use --no-autorelabel";
     "-v",        Arg.Set verbose,           " " ^ s_"Enable debugging messages";
     "--verbose", Arg.Set verbose,           " " ^ s_"Enable debugging messages";
     "-V",        Arg.Unit display_version,  " " ^ s_"Display version and exit";
@@ -216,7 +218,7 @@ read the man page virt-sysprep(1).
   let dryrun = !dryrun in
   let operations = !operations in
   let quiet = !quiet in
-  let selinux_relabel = !selinux_relabel in
+  let autorelabel = !autorelabel in
   let trace = !trace in
   let verbose = !verbose in
 
@@ -239,7 +241,7 @@ read the man page virt-sysprep(1).
   add g dryrun;
   g#launch ();
 
-  debug_gc, operations, g, selinux_relabel, quiet, mount_opts
+  debug_gc, operations, g, autorelabel, quiet, mount_opts
 
 let do_sysprep () =
   (* Inspection. *)
@@ -276,7 +278,7 @@ let do_sysprep () =
 
         (* SELinux relabel? *)
         let relabel =
-          match selinux_relabel, created_files with
+          match autorelabel, created_files with
           | `Force, _ -> true
           | `Never, _ -> false
           | `Auto, created_files -> created_files in
diff --git a/sysprep/virt-sysprep.pod b/sysprep/virt-sysprep.pod
index 9fb3dc2..33ec624 100644
--- a/sysprep/virt-sysprep.pod
+++ b/sysprep/virt-sysprep.pod
@@ -61,6 +61,16 @@ force a particular format use the I<--format> option.
 Add a remote disk.  The URI format is compatible with guestfish.
 See L<guestfish(1)/ADDING REMOTE STORAGE>.
 
+=item B<--autorelabel>
+
+=item B<--no-autorelabel>
+
+I<--autorelabel> forces SELinux relabelling next time the guest
+boots.  I<--no-autorelabel> disables relabelling.
+
+The default is to try to detect if SELinux relabelling is required.
+See L</SELINUX RELABELLING> below for more details.
+
 =item B<-c> URI
 
 =item B<--connect> URI
@@ -218,16 +228,6 @@ Don't print log messages.
 
 To enable detailed logging of individual file operations, use I<-x>.
 
-=item B<--selinux-relabel>
-
-=item B<--no-selinux-relabel>
-
-I<--selinux-relabel> forces SELinux relabelling next time the guest
-boots.  I<--no-selinux-relabel> disables relabelling.
-
-The default is to try to detect if SELinux relabelling is required.
-See L</SELINUX RELABELLING> below for more details.
-
 =item B<-v>
 
 =item B<--verbose>
@@ -528,10 +528,10 @@ SELinux the next time the guest is booted.  This process interrupts
 boot and can take some time.
 
 You can force relabelling for all guests by supplying the
-I<--selinux-relabel> option.
+I<--autorelabel> option.
 
 You can disable relabelling entirely by supplying the
-I<--no-selinux-relabel> option.
+I<--no-autorelabel> option.
 
 =head1 WINDOWS 8
 

-- 
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