Bug 1326653
| Summary: | Virsh blockjob reports unknown job when committing backing chain | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Yang Yang <yanyang> |
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
| Status: | CLOSED ERRATA | QA Contact: | Han Han <hhan> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.8 | CC: | dyuan, hhan, mzhan, rbalakri, xuzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.10.2-61.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-03-21 10:39:03 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: | |||
|
Description
Yang Yang
2016-04-13 09:51:00 UTC
Upstream "accidentally" fixed this by commit:
commit 466b12ab797f3dc1b37005f5501ebec3549e5cad
Author: Eric Blake <eblake>
Date: Fri Feb 21 12:55:06 2014 -0700
virsh: use more compact VIR_ENUM_IMPL
Dan Berrange suggested that using VIR_ENUM_IMPL is more compact
than open-coding switch statements, and still just as forceful
at making us remember to update lists if we add enum values
in the future. Make this change throughout virsh.
Sure enough, doing this change caught that we missed at least
VIR_STORAGE_VOL_NETDIR.
* tools/virsh-domain-monitor.c (vshDomainIOErrorToString)
(vshDomainControlStateToString, vshDomainStateToString)
(vshDomainStateReasonToString): Change switch to enum lookup.
(cmdDomControl, cmdDominfo): Update caller.
* tools/virsh-domain.c (vshDomainVcpuStateToString)
(vshDomainEventToString, vshDomainEventDetailToString): Change
switch to enum lookup.
(vshDomainBlockJobToString, vshDomainJobToString): New functions.
(cmdVcpuinfo, cmdBlockJob, cmdDomjobinfo, cmdEvent): Update
callers.
* tools/virsh-network.c (vshNetworkEventToString): Change switch
to enum lookup.
* tools/virsh-pool.c (vshStoragePoolStateToString): New function.
(cmdPoolList, cmdPoolInfo): Update callers.
* tools/virsh-volume.c (vshVolumeTypeToString): Change switch to
enum lookup.
(cmdVolInfo, cmdVolList): Update callers.
Signed-off-by: Eric Blake <eblake>
Verify it on libvirt-0.10.2-62.el6.x86_64
1. Prepare a running VM b1
2. Runing following script reproduce.sh
```
#!/bin/bash
DOM=b1
DOM_IP=192.168.122.86
for i in s{1..3};do
virsh snapshot-create-as $DOM $i --no-metadata --disk-only
ssh root@$DOM_IP dd if=/dev/urandom of=hello bs=1k count=102400
done
qemu-img info /var/lib/libvirt/images/$DOM.s3 --backing-chain
virsh blockcommit $DOM hda --top /var/lib/libvirt/images/$DOM.s1
for i in {1..10};do
virsh blockjob $DOM hda
done
```
3. Check the result
Domain snapshot s1 created
102400+0 records in
102400+0 records out
104857600 bytes (105 MB) copied, 19.0657 s, 5.5 MB/s
Domain snapshot s2 created
102400+0 records in
102400+0 records out
104857600 bytes (105 MB) copied, 18.5078 s, 5.7 MB/s
Domain snapshot s3 created
102400+0 records in
102400+0 records out
104857600 bytes (105 MB) copied, 18.7518 s, 5.6 MB/s
image: /var/lib/libvirt/images/b1.s3
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 98M
cluster_size: 65536
backing file: /var/lib/libvirt/images/b1.s2
backing file format: qcow2
image: /var/lib/libvirt/images/b1.s2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 101M
cluster_size: 65536
backing file: /var/lib/libvirt/images/b1.s1
backing file format: qcow2
image: /var/lib/libvirt/images/b1.s1
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 94M
cluster_size: 65536
backing file: /var/lib/libvirt/images/b1.qcow2
backing file format: qcow2
image: /var/lib/libvirt/images/b1.qcow2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 1.2G
cluster_size: 65536
Block Commit started
Block Commit: [ 44 %]
Block Commit: [ 48 %]
Block Commit: [ 48 %]
Block Commit: [ 49 %]
Block Commit: [ 49 %]
Block Commit: [ 49 %]
Block Commit: [ 49 %]
Block Commit: [ 49 %]
Block Commit: [ 49 %]
Block Commit: [ 49 %]
No 'unknown job' when blockcommit. Bug fixed.
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-2017-0682.html |