Commits on May 19, 2017
  1. v2v: -o glance: set all properties during creation (RHBZ#1374405)

    ptoscano authored and rwmjones committed Sep 13, 2016
    The glance client v1.0.0 defaults to the Image v2 API: this means that
    an image can be referenced only by its UUID, and not anymore by the name
    as well (which does not need to be unique).  This caused our glance
    invocation to set the properties for the newly created image to fail,
    since we are using the name as identifier.
    Instead of first creating the image and then setting all the properties
    for it, set all the properties when creating the image: other than being
    simpler, it also avoid parsing the output of the 'glance image-create'
    command for the UUID ('id') of the image.
    (cherry picked from commit 1497a9f)
Commits on Dec 22, 2016
  1. v2v: -i ova: Derive the name from the OVA filename.

    rwmjones authored and ptoscano committed Sep 9, 2016
    If the guest has no <Name> element in the OVF, previously we chose
    "default" as the name.  This changes that so it uses a name derived
    from the basename of the OVA file instead.
    For example:
      virt-v2v -i ova /path/to/myguest.ova [...]
    would use "myguest" as the name (assuming no <Name> was present).
    Modifies the behaviour of
    commit 1ae4252.
    (cherry picked from commit 98619f9)
  2. v2v: -i disk: Move code that creates name from disk to separate module.

    rwmjones authored and ptoscano committed Sep 9, 2016
    Simple code motion.
    (cherry picked from commit 312379c)
  3. virt-v2v: Support for ova exported from AWS (RHBZ#1371843).

    shaharha authored and ptoscano committed Sep 8, 2016
    1. AWS the name tag is not mandatory - using default as a name
    2. AWD doesn't prefix 'ovf:' as prefix to disk path
    There is an open bug for oVirt:
    Signed-off-by: Shahar Havivi <>
    (cherry picked from commit 1ae4252)
Commits on Dec 21, 2016
  1. v2v: -o vdsm: Add --vdsm-compat flag. -o rhev: Drop support for RHV <…

    rwmjones authored and ptoscano committed Nov 30, 2016
    … 4.1 (RHBZ#1400205).
    Support for RHEV with RHEL 6 nodes required us to output the old style
    qcow2 compat=0.10 images.  Since RHEV 3.6 GA, RHEL 6 has not been
    supported as a RHEV node type.  Since RHV 4.1, compat=1.1 is
    supported.  (Support for compat=1.1 is uncertain in RHV 4.0 even on
    RHEL 7 nodes.)
    There are significant downsides to using qcow2 compat=0.10 instead of
    the modern default (compat=1.1).
    Therefore this patch does two things:
    For -o rhev, it drops support for compat=0.10 completely.  You must
    use RHV 4.1.
    For -o vdsm, it adds an interim flag (--vdsm-compat=0.10 or
    --vdsm-compat=1.1) which controls the compat level of the qcow2 output
    file.  VDSM should use --vdsm-compat=1.1 when it is known that modern
    qemu is available.  We can make this the default later when all RHV
    instances have moved to 4.1.
    It also adds:
    to the `virt-v2v --machine-readable' output to indicate that this flag
    can be used.
    Thanks: Yaniv Kaul, Michal Skrivanek.
    (cherry picked from commit bdaeeb4)
  2. appliance: Disable EDD (edd=off) (RHBZ#1404287).

    rwmjones authored and ptoscano committed Dec 18, 2016
    EDD ( is a BIOS INT 13h
    subcall for communicating the extended size of the boot disk over 8GB
    to the OS.  Since libguestfs doesn't use a boot disk, and the
    appliance disk is limited to 4GB, and we use virtio-scsi, this is all
    EDD is also broken currently on RHEL 7.3, see:
    Also the EDD probing takes significant extra time (about 80ms on my
    laptop), and using edd=off reduces this time although doesn't entirely
    eliminate it.
    (cherry picked from commit 764fd3f)
Commits on Dec 16, 2016
  1. inspect: gather info from /usr filesystems as well (RHBZ#1401474)

    ptoscano committed Dec 6, 2016
    Flag the filesystems for Linux /usr properly as USR role, and detect
    some data out of it, like the distro information from an os-release
    (if present), and the architecture (since the binaries used for our
    architecture check will be available there only).
    Later on, collect the results in a way similar to what is done for
    CoreOS: for each non-CoreOS root, try to find its /usr filesystem, and
    if found then merge what is missing from root; in the last case, also
    override the distro inspection data (version, product name) if available
    in /usr.
    (cherry picked from commit 1d86b37)
  2. inspect: fix existance check of /dev/mapper devices

    ptoscano authored and rwmjones committed Dec 6, 2016
    When checking for the existance of /dev/mapper devices found in the
    fstab of a filesystem, using guestfs_exists means they are checked as
    files in the guest, while they really appear as devices on the
    appliance. Instead, try the lvm name resolution anyway, and ignore them
    when they are reported as missing.
    Thanks to: Richard W.M. Jones.
    Fixes commit 96b6504.
    (cherry picked from commit dad35e5)
  3. inspect: mark CoreOS /usr partitions with own USR role

    ptoscano authored and rwmjones committed Dec 5, 2016
    Add a new inspect role for "/usr" partitions, and use that to mark the
    /usr partition in CoreOS: this additional role allows to ease its lookup
    later on, when merging its results into those of the root.
    (cherry picked from commit e77e1ef)
  4. inspect: change is_root flag into enum

    ptoscano authored and rwmjones committed Dec 5, 2016
    Introduce a new enum to classify the role of a filesystem, if available.
    This will help later on when doing operations on non-root filesystems,
    like detecting particular mountpoints such as /usr.
    The new enum has only "root" as known role, which replaces the is_root
    (cherry picked from commit 0c4edce)
Commits on Aug 30, 2016
  1. tests: add rhbz1370424.xml to EXTRA_DIST

    ptoscano authored and rwmjones committed Aug 29, 2016
    Fixes commit 98aa78f.
    (cherry picked from commit f14dd26)
  2. tests: Add a regression test for RHBZ#1370424.

    rwmjones committed Aug 27, 2016
    Regression test for previous commit which just tests that
    guestfs_add_domain doesn't assert-fail on guests with no port
    (cherry picked from commit 98aa78f)
  3. lib: Don't assert fail if port is missing in XML (RHBZ#1370424).

    rwmjones committed Aug 27, 2016
    Thanks: Xiaodai Wang
    (cherry picked from commit 9e7b564)
Commits on Aug 18, 2016
  1. aarch64: uefi: Fix the build on aarch64.

    rwmjones committed Aug 18, 2016
    Fixes commit 0c39665.
    (cherry picked from commit c711b51)
  2. v2v: Use OVMF secure boot file (RHBZ#1367615).

    rwmjones committed Aug 17, 2016
    From RHEL 7.3, Red Hat have decided to only compile the secure boot
    version of OVMF on x86-64, with flags -D SECURE_BOOT_ENABLE -D SMM_REQUIRE.
    The filename has also changed to reflect this - it is now
    /usr/share/OVMF/OVMF_CODE.secboot.fd.  The old file
    /usr/share/OVMF/OVMF_CODE.fd is no longer shipped.
    However switching to using this variant of OVMF for UEFI guests is not
    just a matter of changing the filename.  The new OVMF variant won't
    run unless we also change:
     - The qemu machine model, from the default ("pc" ==
       "pc-i440fx-rhel7.3.0" or later) to Q35 ("q35" == "pc-q35-rhel7.3.0"
       or later).
     - Add <smm> under <features>.
     - Set <loader ... secure="yes">.
    NB: On RHEL the changes requires qemu-kvm-rhev.  It is no longer
    possible to convert UEFI guests using the basic qemu-kvm.
    Thanks: Laszlo Ersek, Ming Xie.
    (cherry picked from commit ba5c5a8713c4418c861edecacff761f4d3720508)
  3. Generate the lists of UEFI firmware paths.

    rwmjones committed Aug 18, 2016
    Previously we had a list of UEFI paths in src/uefi.c, which was
    accessed in virt-v2v using a private (guestfs_int_*) API and some C
    binding code.  This was clumsy and required the paths to be replicated
    in the virt-v2v unit tests.
    Instead just generate the list of paths from the generator, creating
    src/uefi.c and v2v/ with the same content.
    Remove the C bindings and the virt-v2v unit tests associated with UEFI
    Cherry picked from commit 04fc67775e27851ce9b6c7a082ff80f1e1793365.
    For this complex cherry pick I had to take into account earlier
    RHEL-only patches where we removed several sets of firmware.
  4. v2v: OVMF is now fully open source, fix the man page.

    rwmjones committed Aug 17, 2016
    (cherry picked from commit 5c03a2c)
  5. v2v: Add -o discard option when fstrimming.

    rwmjones committed Aug 12, 2016
    This *may* be required by some filesystems in order for fstrim to
    work.  I'm not actually sure if this is true, but it's what
    virt-sparsify --in-place does, and that utility has been tested a lot
    more in regards to trimming.
    (cherry picked from commit dd22e37)
  6. v2v: Make fstrim warning clearer (RHBZ#1366456).

    rwmjones committed Aug 12, 2016
    This reverts the change made for RHBZ#1168144.  The warning is now
    always displayed.
    It would be nice to make the warning actionable, but there is not a
    lot that end users can do since fstrim is such a complex topic
    interacting with all filesystem and storage layers.
    (cherry picked from commit 66816e1)
  7. p2v: Fix s/is/are/ in GUI message.

    rwmjones committed Aug 12, 2016
    I reordered the 'and' clause to make it sound a bit more natural.
    Thanks: Junqin Zhou.
    (cherry picked from commit d33e28c)
Commits on Aug 8, 2016
  1. sparsify: Add a regression test for RHBZ#1364347.

    rwmjones committed Aug 5, 2016
    Add a regression test for the previous commit.
    (cherry picked from commit 71de3d4)
  2. sparsify: Warn instead of error if a filesystem cannot be fstrimmed (…

    rwmjones committed Aug 5, 2016
    Thanks:  Xianghua Chen
    (cherry picked from commit 4d5335a)
  3. daemon: fstrim: Turn "discard operation is not supported" into ENOTSUP.

    rwmjones committed Aug 5, 2016
    Because we run the external fstrim command we don't have access to the
    kernel errno when it fails.  However in the case where it prints this
    specific error message, turn that into errno ENOTSUP.
    (cherry picked from commit 116a41d)
  4. sparsify: Exit with error code 3 if fstrim is not supported by the ap…

    rwmjones committed Aug 5, 2016
    This replaces the indirect exception catching from
    commit 931aec5 with a direct feature
    Fixes commit 931aec5.
    (cherry picked from commit 97b6b4a)
  5. mllib: _exit should return 'a

    rwmjones committed Aug 4, 2016
    Fixes commit 0dfa96c.
    (cherry picked from commit 9fc0418)
  6. dib: rework run of extra-data.d hooks (RHBZ#1362354)

    ptoscano authored and rwmjones committed Aug 3, 2016
    Instead of running them before lanching the appliance with the disks and
    then uploading the result after root.d hooks run, mount the root in the
    local temporary directory using FUSE and then run the hooks on the
    guest.  Other than being closer to what diskimage-builder does, it also
    avoids issues with the extra-data.d scripts assuming to find things
    already, and we don't error out while trying to unpack files on the
    Since virt-dib requires FUSE now, build it only if FUSE is supported.
    (cherry picked from commit d12be66)
  7. mllib: move _exit from v2v as Exit module

    ptoscano authored and rwmjones committed Aug 3, 2016
    Move the OCaml binding to C _exit to an own module.
    Just code motion, adapting v2v in the process.
    (cherry picked from commit 5077c02)
  8. podcheck: Check tool --help output.

    rwmjones committed Jul 19, 2016
    For OCaml tools this does essentially nothing useful because the
    --help output is automatically generated from the options, and so
    cannot be wrong.  However for C tools this is a useful check.
    It would be nice to generate C tools --help output, but there isn't
    enough information in the getopt data to do that.
    This commit also includes fixes to the --help output for a few tools.
    (cherry picked from commit 5e65da0)
  9. mllib: check for executable existance in run_command (RHBZ#1362357)

    ptoscano authored and rwmjones committed Aug 2, 2016
    run_command uses Unix.create_process which forks a child process, and
    executes execve: the latter fails when the executable does not exist,
    triggering the exit which, in older OCaml versions [1], also runs the
    at_exit handlers.
    Since there is not much that can be done to avoid this on the OCaml
    side, to keep run_command working also in older OCaml version then
    manually search for the existance of the given executable, exiting with
    code 127 (as a shell does) in this case.
    (cherry picked from commit 2cb053d)
  10. mllib: move which and its exception from dib

    ptoscano authored and rwmjones committed Aug 2, 2016
    Rename it from "tool" to "executable" in the process, but otherwise
    it is just code motion (with minimal adjustments in dib).
    (cherry picked from commit 398b940)
  11. Revert "p2v: Disable SELinux in virt-p2v-make-disk."

    rwmjones committed Jul 21, 2016
    The commit claimed that SELinux was disabled in the
    virt-p2v-make-kickstart script, and so this was just making things
    consistent.  However this is not true.  SELinux *is* enabled in the
    kickstart version.  There is some code to disable it, but it is
    commented out (admittedly it's hard to tell because the code is buried
    in a multi-line sed expression).
    The commit message also claimed (this time correctly) that the
    '--selinux-relabel' step caused an extra reboot each time virt-p2v is
    run from the ISO.  However we have recently fixed this so it can
    usually do the relabelling during the build, not at boot time, so this
    is no longer a problem.
    This reverts commit 25ffcc7.
    (cherry picked from commit fcce1f6)
  12. v2v: linux: Use new SELinux_relabel module to relabel Linux guests.

    rwmjones committed Jul 13, 2016
    (cherry picked from commit fc11490)
  13. lib: Deprecate old SELinux APIs, rewrite SELinux documentation (RHBZ#…

    rwmjones committed Jul 13, 2016
    Also turns the --selinux option of guestfish, guestmount and
    virt-rescue into a no-op -- it didn't work before so this is
    effectively no change.
    (cherry picked from commit 35bac3a)
  14. builder: Use virt-sysprep --selinux-relabel when preparing templates.

    rwmjones committed Jul 13, 2016
    Don't need to be clever now.
    (cherry picked from commit b6e92b1)