Bug 1148072 - Option missing --no-selinux-relabel
Summary: Option missing --no-selinux-relabel
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libguestfs
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-30 16:01 UTC by Ade Bradshaw
Modified: 2014-10-01 08:45 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-01 08:45:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ade Bradshaw 2014-09-30 16:01:41 UTC
Description of problem:
In Fedora 19, virt-sysprep had a "--no-selinux-relabel" option
In Fedora 20, this option no longer seems to be present

Version-Release number of selected component (if applicable):
libguestfs-tools-1.22.9-1.fc19.x86_64 - has the option
libguestfs-tools-1.26.9-1.fc20.noarch - doesnt



How reproducible:


Steps to Reproduce:
1. On Fedora 20, install libguestfs-tools
2. $ virt-sysprep --no-selinux-relabel -a Downloads/rhel-guest-image-6.4-2014.0.x86_64.qcow2 
3.

Actual results:
$ virt-sysprep --no-selinux-relabel -a Downloads/rhel-guest-image-6.4-2014.0.x86_64.qcow2 
virt-sysprep: unknown option `--no-selinux-relabel'.


Expected results:
The sysprep works, as it does in F19

Additional info:
$ virt-sysprep -help
virt-sysprep: reset or unconfigure a virtual machine so clones can be made

 virt-sysprep [--options] -d domname

 virt-sysprep [--options] -a disk.img [-a disk.img ...]

A short summary of the options is given below.  For detailed help please
read the man page virt-sysprep(1).

  -a file               Add disk image file
  --add file            Add disk image file
  -c uri                Set libvirt URI
  --connect uri         Set libvirt URI
  -d domain             Set libvirt guest name
  --debug-gc            Debug GC and memory allocations (internal)
  --domain domain       Set libvirt guest name
  --dry-run             Perform a dry run
  --dryrun              Perform a dry run
  --dump-pod            Dump POD (internal)
  --dump-pod-options    Dump POD for options (internal)
  --enable operations   Enable specific operations
  --firstboot script    run script once next time guest boots
  --format format       Set format (default: auto)
  --hostname hostname   New hostname
  --list-operations     List supported operations
  --long-options        List long options
  -n                    Perform a dry run
  --no-selinux-relabel  Never do SELinux relabel
  -q                    Don't print log messages
  --quiet               Don't print log messages
  --script script       Script or program to run on guest
  --scriptdir dir       Mount point on host
  --selinux-relabel     Force SELinux relabel
  -v                    Enable debugging messages
  -V                    Display version and exit
  --verbose             Enable debugging messages
  --version             Display version and exit
  -x                    Enable tracing of libguestfs calls
  -help                 Display this list of options
  --help                Display this list of options


$ virt-sysprep -help
virt-sysprep: reset or unconfigure a virtual machine so clones can be made

 virt-sysprep [--options] -d domname

 virt-sysprep [--options] -a disk.img [-a disk.img ...]

A short summary of the options is given below.  For detailed help please
read the man page virt-sysprep(1).

  -a file               Add disk image file
  --add file            Add disk image file
  -c uri                Set libvirt URI
  --connect uri         Set libvirt URI
  -d domain             Set libvirt guest name
  --debug-gc            Debug GC and memory allocations (internal)
  --domain domain       Set libvirt guest name
  --dry-run             Perform a dry run
  --dryrun              Perform a dry run
  --dump-pod            Dump POD (internal)
  --dump-pod-options    Dump POD for options (internal)
  --enable operations   Enable specific operations
  --firstboot script    run script once next time guest boots
  --format format       Set format (default: auto)
  --hostname hostname   New hostname
  --list-operations     List supported operations
  --long-options        List long options
  -n                    Perform a dry run
  --no-selinux-relabel  Never do SELinux relabel
  -q                    Don't print log messages
  --quiet               Don't print log messages
  --script script       Script or program to run on guest
  --scriptdir dir       Mount point on host
  --selinux-relabel     Force SELinux relabel
  -v                    Enable debugging messages
  -V                    Display version and exit
  --verbose             Enable debugging messages
  --version             Display version and exit
  -x                    Enable tracing of libguestfs calls
  -help                 Display this list of options
  --help                Display this list of options

Comment 1 Pino Toscano 2014-09-30 16:15:41 UTC
(In reply to Ade Bradshaw from comment #0)
> Description of problem:
> In Fedora 19, virt-sysprep had a "--no-selinux-relabel" option
> In Fedora 20, this option no longer seems to be present

Since libguestfs 1.26 (1.25.47, to be precise), there is no more autodetection whether a relabel was needed or not (and thus you needed to specify --selinux-label to force it, or --no-selinux-relabel to never do it).

Instead, no relabel is done by default, and you need to specify --selinux-relabel if you want to do it (even if the operations don't require it).

Comment 2 noc 2014-09-30 16:34:16 UTC
Oh, thanks for that Pino

Comment 3 Richard W.M. Jones 2014-09-30 22:33:23 UTC
Ade's bug is correct however since the option shouldn't have simply
been dropped.  It might still be present and have no effect, or print
a warning, or something.

Comment 4 Pino Toscano 2014-10-01 08:45:30 UTC
No-op option added back with
https://github.com/libguestfs/libguestfs/commit/d39744a030d075cdff82f1ca4c80ec40bdcfb699
which is in libguestfs >= 1.27.57.


Note You need to log in before you can comment on or make changes to this bug.