ping On Fri, Dec 22, 2023 at 5:21 PM Fangge Jin <f...@redhat.com> wrote:
> Guest kernel: kernel-5.14.0-401.el9.x86_64 > > On Fri, Dec 22, 2023 at 5:20 PM Fangge Jin <f...@redhat.com> wrote: > >> Hi guys, >> >> I'm testing USB disk recently, I changed the block size of USB disk in vm >> xml and started vm. >> vm started successfully, but when I checked it in guest, I found the >> setting didn't take effect. >> >> Versions: >> libvirt-9.9.0-1.el9.x86_64 >> qemu-kvm-8.1.0-5.el9.x86_64 >> >> Steps: >> 1. Start a vm with usb disk and block size configurations in xml: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *# virsh dumpxml vm2 --xpath //disk<disk type="file" device="disk"> >> <driver name="qemu" type="qcow2"/> <source >> file="/var/lib/libvirt/images/RHEL-9.4.0-20231221.12-x86_64-ovmf.qcow2" >> index="2"/> <backingStore/> <target dev="vda" bus="virtio"/> <boot >> order="1"/> <alias name="virtio-disk0"/> <address type="pci" >> domain="0x0000" bus="0x08" slot="0x00" function="0x0"/></disk><disk >> type="file" device="disk"> <driver name="qemu" type="qcow2"/> <source >> file="/var/lib/libvirt/images/test1.qcow2" index="1"/> <backingStore/> >> <blockio logical_block_size="1024" physical_block_size="1024" >> discard_granularity="1024"/> <target dev="hda" bus="usb"/> <alias >> name="usb-disk0"/> <address type="usb" bus="0" port="1"/></disk>* >> >> 2. Check the qemu command line >> *-blockdev >> {"driver":"file","filename":"/var/lib/libvirt/images/test1.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"} >> * >> *-blockdev >> {"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":null} >> * >> *-device >> {"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt-1-format","id":"usb-disk0","logical_block_size":1024,"physical_block_size":1024,"discard_granularity":1024,"removable":false}* >> >> 3. Log in vm, and check block size: >> >> >> >> *[root@localhost ~]# blockdev --getss /dev/sda (logical block size, >> expected value is 1024)512[root@localhost ~]# blockdev --getpbsz /dev/sda >> (physical block size, expected value is 1024)512* >> >> >> BR, >> Fangge Jin >> >