Hide Forgot
Description of problem: Virsh blockjob reports unknown job when committing backing chain # virsh blockjob vm2 hda Unknown job: [ 15 %] It should report like this # virsh blockjob vm2 hda Block Commit: [ 15 %] Version-Release number of selected component (if applicable): libvirt-0.10.2-60.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. create 3 external snapshots # virsh snapshot-create-as vm2 s1 --no-metadata --disk-only --quiesce Domain snapshot s1 created # virsh console vm2 [root@localhost]# dd if=/dev/zero of=hello bs=1024 count=102400 # virsh snapshot-create-as vm2 s2 --no-metadata --disk-only --quiesce Domain snapshot s2 created # virsh console vm2 [root@localhost]# dd if=/dev/zero of=hello2 bs=1024 count=102400 # virsh snapshot-create-as vm2 s3 --no-metadata --disk-only --quiesce Domain snapshot s3 created # virsh console vm2 [root@localhost]# dd if=/dev/zero of=hello3 bs=1024 count=102400 # qemu-img info /var/lib/libvirt/images/vm2.s3 --backing-chain image: /var/lib/libvirt/images/vm2.s3 file format: qcow2 virtual size: 8.0G (8589934592 bytes) disk size: 20M cluster_size: 65536 backing file: /var/lib/libvirt/images/vm2.s2 backing file format: qcow2 image: /var/lib/libvirt/images/vm2.s2 file format: qcow2 virtual size: 8.0G (8589934592 bytes) disk size: 101M cluster_size: 65536 backing file: /var/lib/libvirt/images/vm2.s1 backing file format: qcow2 image: /var/lib/libvirt/images/vm2.s1 file format: qcow2 virtual size: 8.0G (8589934592 bytes) disk size: 103M cluster_size: 65536 backing file: /var/lib/libvirt/images/vm2.img backing file format: raw image: /var/lib/libvirt/images/vm2.img file format: raw virtual size: 8.0G (8589934592 bytes) disk size: 8.0G 2. committing into base image # virsh blockcommit vm2 hda --top /var/lib/libvirt/images/vm2.s1 Block Commit started 3. query blockjob # virsh blockjob vm2 hda Unknown job: [ 15 %] Actual result Virsh blockjob reports unknown job when committing into base image Expected result Virsh blockjob reports like this # virsh blockjob vm2 hda Block Commit: [ 15 %] Additional info:
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