RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1218934 - virt-sparsify: read all the output from 'qemu-img --help'
Summary: virt-sparsify: read all the output from 'qemu-img --help'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.6
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Pino Toscano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1301844
TreeView+ depends on / blocked
 
Reported: 2015-05-06 08:34 UTC by Pino Toscano
Modified: 2016-05-10 19:55 UTC (History)
7 users (show)

Fixed In Version: libguestfs-1.20.11-16.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 19:55:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0762 0 normal SHIPPED_LIVE libguestfs bug fix update 2016-05-10 22:33:40 UTC

Description Pino Toscano 2015-05-06 08:34:09 UTC
Description of problem:
It seems like `qemu-img --help` may just crash when being run by virt-sparsify to determine its version, causing virt-sparsify to fail.
A workaround to this situation seems to be reading all the output instead of just the first line of it. This does not apply to RHEL 7.1+, as a newer qemu is required and thus there is no need to get the qemu-img version.

Version-Release number of selected component (if applicable):
libguestfs-1.20.11-13.el6 

How reproducible:
Running virt-sparsify, sometimes.

Expected results:
virt-sparsify works.

Comment 2 Pino Toscano 2015-11-10 13:02:46 UTC
This was actually a workaround for what was actually bug #1233292.  Hence not relevant nor needed anymore.

Comment 3 Pino Toscano 2015-11-12 12:18:11 UTC
Actually I take it back: `qemu-img --help` seems to not like much when closing stdout for it while it is still running (that is, closing the process after reading only the first line of its lengthy output.

So yes, we need to read its output to not get into troubles.

Comment 5 Xianghua Chen 2015-12-02 06:10:16 UTC
Verified with the packages:
libguestfs-1.20.11-16.el6.x86_64

Verify steps:
# guestfish -N fs

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> quit

# virt-sparsify test1.img  outdisk.img -x -v
......
guestfsd: main_llibguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 1a | 00 00 00 01 | 00 12 34 0d | ...
libguestfs: trace: internal_autosync = 0
libguestfs: sending SIGTERM to process 17063
libguestfs: trace: shutdown = 0
libguestfs: trace: close
libguestfs: closing guestfs handle 0x1e13d50 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfswvXl1p
Copy to destination and make sparse ...
qemu-img convert -f qcow2 -O 'raw' '/tmp/sparsify28214f.qcow2' './outdisk.img'
Sparsify operation completed with no errors.  Before deleting the old 
disk, carefully check that the target disk boots and works correctly.

Repeat the command above for several times, there is no error occurred. 
Can also refer to bug #1233292 which has been fixed, and this bug will be fixed too.


So verified.

Comment 7 errata-xmlrpc 2016-05-10 19:55:58 UTC
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-2016-0762.html


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