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 814102 - mirroring starts anyway with "existing" mode and a non-existing target
Summary: mirroring starts anyway with "existing" mode and a non-existing target
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.3
Hardware: Unspecified
OS: Unspecified
urgent
medium
Target Milestone: rc
: ---
Assignee: Jeff Cody
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 844627 861905 864962
TreeView+ depends on / blocked
 
Reported: 2012-04-19 09:09 UTC by Shaolong Hu
Modified: 2013-02-21 13:07 UTC (History)
13 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.297.el6
Doc Type: Bug Fix
Doc Text:
A mirroring operation set to "existing" mode was executed even when a target did not exist. Consequently, snapshot-related operations could not be performed because the block device was in use by the mirroring job. Now, a mirror block job is not created if the target bdrv_open() call fails, so mirroring does not start when the target does not exist.
Clone Of:
: 861905 (view as bug list)
Environment:
Last Closed: 2013-02-21 13:07:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0543 0 normal SHIPPED_LIVE qemu-kvm-rhev, qemu-kvm-rhev-tools, qemu-img-rhev bug fix update 2013-02-21 18:06:57 UTC

Description Shaolong Hu 2012-04-19 09:09:57 UTC
Description of problem:
--------------------------
mirroring with "existing" mode and a non-existing target starts anyway.

Version-Release number of selected component (if applicable):
--------------------------------------------------------------
qemu-kvm-rhev-0.12.1.2-2.278.el6.x86_64

How reproducible:
------------------
100%

Steps to Reproduce:
1.boot guest with QMP
2.in QMP connection, /root/sn1 does not exist:
{ "execute" : "__com.redhat_drive-mirror", "arguments" : { "device" : "drive-virtio-disk0", "target" : "/root/sn1", "format": "qcow2", "mode": "existing", "full" : false } }
3.mirror starts:
(qemu) info block-jobs
Type mirror, device drive-virtio-disk0: Completed 0 of 0 bytes, speed limit 0 bytes/s
(qemu) info block-jobs
Type mirror, device drive-virtio-disk0: Completed 0 of 0 bytes, speed limit 0 bytes/s
4.following snapshot related operation complains block device in use.

Comment 2 Jeff Cody 2012-05-29 17:49:23 UTC
I am able to partially reproduce this on qemu-kvm-0.12.1.2-2.295.el6.  When I attempt to mirror to a non-existent target while in existing mode, I do get a valid error back:


{"error": {"class": "OpenFileFailed", "desc": "Could not open '/tmp/sn1'", "data": {"filename": "/tmp/sn1"}}}


However, I am still seeing item 4 from comment #1, when trying to subsequently perform a snapshot on the device:


{ "execute": "transaction", "arguments":
  {'actions': [
    { 'type': 'blockdev-snapshot-sync', 'data' :
      { 'device': 'virtio0', 'snapshot-file': '/tmp/f16-snap1.qcow2' } }
     ] } }

{"error": {"class": "DeviceInUse", "desc": "Device 'virtio0' is in use", "data": {"device": "virtio0"}}}

Comment 3 Jeff Cody 2012-05-30 18:55:38 UTC
The 'DeviceInUse' condition after a failed mirroring attempt happens because the block job is created (which sets the BDS to be 'in use'), but on failure of opening the BDS, the block job is not cleaned up.

The simple solution would be to just not start the block job if opening the BDS fails.

Comment 14 Shaolong Hu 2012-11-30 07:42:47 UTC
Verified on qemu-kvm-rhev-0.12.1.2-2.337.el6.x86_64:

1.{ "execute": "qmp_capabilities" }
{"return": {}}

2.{ "execute": "__com.redhat_drive-mirror", "arguments": { "device": "drive-virtio-disk0", "target": "/root/sn1", "format": "qcow2", "mode": "existing" } }
{"error": {"class": "OpenFileFailed", "desc": "Could not open '/root/sn1': No such file or directory", "data": {"filename": "/root/sn1", "__com.redhat_error_message": "No such file or directory"}}}

3.{ "execute": "blockdev-snapshot-sync", "arguments": { "device": "drive-virtio-disk0", "snapshot-file": "/root/sn1", "format": "qcow2" } }
{"return": {}}

4.(qemu) info block
drive-virtio-disk0: removable=0 io-status=ok file=/root/sn1 backing_file=RHEL6.4 ro=0 drv=qcow2 encrypted=0

Comment 16 errata-xmlrpc 2013-02-21 13:07:34 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.

http://rhn.redhat.com/errata/RHBA-2013-0543.html


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