Bug 1122557
Summary: | virt-sparsify overwrites block devices if used as output files | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Federico Simoncelli <fsimonce> |
Component: | libguestfs | Assignee: | Pino Toscano <ptoscano> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.6 | CC: | huzhan, jherrman, leiwang, mbooth, ptoscano, rbalakri, rjones, utkarshsins, wshi |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.20.11-13.el6 | Doc Type: | Bug Fix |
Doc Text: |
As a result of the fix for BZ#1056558, it was not possible to use a block device for output when using the virt-sparsify utility. This update re-enables block devices to be used as ouput in virt-sparsify.
|
Story Points: | --- |
Clone Of: | 1056290 | Environment: | |
Last Closed: | 2015-07-22 05:55:25 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1056290 | ||
Bug Blocks: | 1056556, 1056558 |
Description
Federico Simoncelli
2014-07-23 13:46:29 UTC
(In reply to Richard W.M. Jones from comment #2) > Patch posted: > > https://www.redhat.com/archives/libguestfs/2014-July/msg00073.html Just for the record, we are not risking to hit bug 1056290 again? Thanks. (In reply to Federico Simoncelli from comment #3) > (In reply to Richard W.M. Jones from comment #2) > > Patch posted: > > > > https://www.redhat.com/archives/libguestfs/2014-July/msg00073.html > > Just for the record, we are not risking to hit bug 1056290 again? Thanks. It's a good question. The code in virt-sparsify just runs: qemu-img convert overlay outdisk The root cause of bug 1056290 was not in libguestfs, it was in qemu-img, or more specifically in the block layer in qemu. I have tested qemu-img convert in RHEL 6.5 against a loop device and it correctly opens the block device. It doesn't delete or overwrite the device node. I have also tested virt-sparsify against an LV on recent Fedora, and that works. So we may have just hit a transient bug in qemu-img. Upstream commit: https://github.com/libguestfs/libguestfs/commit/12b54ef5e3aecd55d228a96dfb0a9ab5c8acdf4a Can reproduce with libguestfs-1.20.11-2.el6 Steps to reproduce: #virt-sparsify rhel77.img /dev/VolGroup/test qemu-img version 0.9 Create overlay file to protect source disk ... Examine source disk ... 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ --:-- Fill free space in /dev/rhel/root with zero ... 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 Clearing Linux swap on /dev/rhel/swap ... 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 Fill free space in /dev/sda1 with zero ... 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 Copy to destination and make sparse ... ...... Verified with the package version: libguestfs-1.20.11-14.el6.x86_64 Verify steps: 1. # virt-sparsify RHEL-Server-7.1-64-hvm-2.raw /dev/vg_ibmx3650m303/test qemu-img version 0.9 Input disk virtual size = 10486808576 bytes (9.8G) Create overlay file in /tmp to protect source disk ... Examine source disk ... Fill free space in /dev/rhel/root with zero ... 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 Clearing Linux swap on /dev/rhel/swap ... 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 Fill free space in /dev/sda1 with zero ... 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 Fill free space in volgroup rhel with zero ... Copy to destination and make sparse ... Sparsify operation completed with no errors. Before deleting the old disk, carefully check that the target disk boots and works correctly. --------end-------- 2. # virt-sparsify RHEL-Server-7.1-64-hvm-2.raw /dev/input/mouse0 virt-sparsify: error: output '/dev/vcs' cannot be a character device, it must be a regular file virt-sparsify: If reporting bugs, run virt-sparsify with debugging enabled (-v) and include the complete output. --------end-------- So the output can be a block device, but not a char device. Verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1444.html |