Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Libvirt doesn't keep disk mirror state synchronization with qemu
Version-Release number of selected component (if applicable):
libvirt-1.2.16-1.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Trigger a failed blockcopy job, just as below
# virsh blockcopy r7 vda /var/lib/libvirt/images/r7.s1 --granularity 4096 --verbose --wait
Block Copy: [ 0 %]
Now in mirroring phase
# virsh blockjob r7 vda
No current block job for vda
# virsh dumpxml r7|grep mirror
2.Query block job status
# virsh qemu-monitor-command r7 '{"execute":"query-block-jobs"}'
{"return":[],"id":"libvirt-31"}
3.Try a blockjob with "--abort"
# virsh blockjob r7 vda --abort
error: Requested operation is not valid: another job on disk 'vda' is still being ended
Actual results:
In step2, there is no block job, while in step 3 libvirt still report there is a blockjob when do "--abort"
Seem the disk->mirrorState doesn't sync before do abort
Expected results:
Additional info:
I used to reproduce it on upstream, but now I can't
$ sed -n 16360,16368p src/qemu/qemu_driver.c
if (!(device = qemuDiskPathToAlias(vm, path, &idx)))
goto endjob;
disk = vm->def->disks[idx];
if (disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_NONE &&
disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_READY) {
virReportError(VIR_ERR_OPERATION_INVALID,
_("another job on disk '%s' is still being ended"),
This is already fixed upstream by:
commit b247d47f397f02dde622a78715c06658bb587003
Author: Jiri Denemark <jdenemar>
Date: Tue May 19 08:44:16 2015 +0200
qemu: Don't mess with disk->mirrorState
This patch reverts commit 76c61cdca20c106960af033e5d0f5da70177af0f.
VIR_DOMAIN_DISK_MIRROR_STATE_ABORT says we asked for a block job to be
aborted rather than saying it was aborted. Let's just use
VIR_DOMAIN_DISK_MIRROR_STATE_NONE consistently whenever a block job
finishes since no caller depends on VIR_DOMAIN_DISK_MIRROR_STATE_ABORT
(anymore) to check whether a block job failed or it was cancelled.
Signed-off-by: Jiri Denemark <jdenemar>
v1.2.16-247-gb247d47
I can reproduce it with libvirt-1.2.16-1.el7.x86_64.
Verified with libvirt-1.2.17-1.el7.x86_64
Steps
1. prepare a transient domain and do blockcopy
# virsh blockcopy simple vda /tmp/simple.copy --granularity 4096 --wait --verbose
Block Copy: [ 0 %]error: Block Copy unexpectedly failed
2. query blockjob status
# virsh blockjob simple vda
No current block job for vda
[root@rhel7_test ~]# virsh qemu-monitor-command simple '{"execute":"query-block-jobs"}'
{"return":[],"id":"libvirt-101"}
3. abort blockjob
# virsh blockjob simple vda --abort
error: Requested operation is not valid: No active operation on device: drive-virtio-disk0
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-2202.html
Description of problem: Libvirt doesn't keep disk mirror state synchronization with qemu Version-Release number of selected component (if applicable): libvirt-1.2.16-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Trigger a failed blockcopy job, just as below # virsh blockcopy r7 vda /var/lib/libvirt/images/r7.s1 --granularity 4096 --verbose --wait Block Copy: [ 0 %] Now in mirroring phase # virsh blockjob r7 vda No current block job for vda # virsh dumpxml r7|grep mirror 2.Query block job status # virsh qemu-monitor-command r7 '{"execute":"query-block-jobs"}' {"return":[],"id":"libvirt-31"} 3.Try a blockjob with "--abort" # virsh blockjob r7 vda --abort error: Requested operation is not valid: another job on disk 'vda' is still being ended Actual results: In step2, there is no block job, while in step 3 libvirt still report there is a blockjob when do "--abort" Seem the disk->mirrorState doesn't sync before do abort Expected results: Additional info: I used to reproduce it on upstream, but now I can't $ sed -n 16360,16368p src/qemu/qemu_driver.c if (!(device = qemuDiskPathToAlias(vm, path, &idx))) goto endjob; disk = vm->def->disks[idx]; if (disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_NONE && disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_READY) { virReportError(VIR_ERR_OPERATION_INVALID, _("another job on disk '%s' is still being ended"),