Bug 1733044
Summary: | Fail to parse ':' nbd exportname in before blockdev-add | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Han Han <hhan> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | Han Han <hhan> |
Severity: | unspecified | Docs Contact: | Peter Krempa <pkrempa> |
Priority: | unspecified | ||
Version: | 8.1 | CC: | dyuan, jdenemar, jgao, xuzhang |
Target Milestone: | rc | ||
Target Release: | 8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-5.9.0-1.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-05-05 09:46:33 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
Han Han
2019-07-25 05:50:15 UTC
Fixed upstream: commit 96f0a17ead829b9b8ae185660b412635642edf85 Author: Peter Krempa <pkrempa> Date: Wed Jul 31 17:17:30 2019 +0200 util: storage: Fix parsing of 'exportname' from legacy NBD strings If the nbd export name contains a colon, our parser would not parse it properly as we split the string by colons. Modify the code to look up the exportname and copy any trailing characters as the export name is supposed to be at the end of the string. https://bugzilla.redhat.com/show_bug.cgi?id=1733044 Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Jiri Denemark <jdenemar> v5.6.0-197-g96f0a17ead Vefified on libvirt-6.0.0-1.module+el8.2.0+5453+31b2b136.x86_64 qemu-kvm-4.2.0-6.module+el8.2.0+5453+31b2b136.x86_64: 1. Create a nbd server with exportname in various character: # qemu-nbd -f raw /var/lib/libvirt/images/nbd.qcow2 -x "$(for ((i=32;i<127;i++)) do printf "\\$(printf %03o "$i")"; done)是魔鬼的步伐" -t -e 10 2. Create a qcow2 based on the exportname: # qemu-img create -b nbd:localhost:10809:exportname="$(awk 'BEGIN{for(i=32;i<127;i++)printf "%c",i; print}')是魔鬼的步伐" -o backing_fmt=qcow2 -f qcow2 /tmp/new.qcow2 Formatting '/tmp/new.qcow2', fmt=qcow2 size=10737418240 backing_file=nbd:localhost:10809:exportname= !"#$%&'()*+,,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~是魔鬼的步伐 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 3. Start an VM with the overlay image: # virsh dumpxml pc|xmllint --xpath //disk - <disk type="file" device="disk"> <driver name="qemu" type="qcow2"/> <source file="/tmp/new.qcow2" index="1"/> <backingStore type="network" index="2"> <format type="qcow2"/> <source protocol="nbd" name=" !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~是魔鬼的步伐" tls="no"> <host name="localhost" port="10809"/> </source> </backingStore> <target dev="vda" bus="virtio"/> <alias name="virtio-disk0"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/> </disk> 4. Blockcommit to the nbd disk: # virsh blockcommit pc vda --active --wait --verbose --pivot Block commit: [100 %] Successfully pivoted # virsh dumpxml pc|xmllint --xpath //disk - <disk type="network" device="disk"> <driver name="qemu" type="qcow2"/> <source protocol="nbd" name=" !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~是魔鬼的步伐" tls="no" index="2"> <host name="localhost" port="10809"/> </source> <target dev="vda" bus="virtio"/> <alias name="virtio-disk0"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/> </disk> Covered by unit test virstoragetest 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://access.redhat.com/errata/RHBA-2020:2017 |