kvm-guest-drivers-windows: virtio-scsi with lio/vhost: strange block device size and LUKS problems
I am using virtio-scsi (0.1.171-1) with the LIO/vhost backend. That works great with Linux and with Windows in normal cases. With normal I mean that targetcli has an iblock object for lets say /dev/sdc7 and a vhost target with a lun that references the iblock object.
However, on Windows the disk size differs from what Linux says about /dev/sdc7.
# blockdev --getsz /dev/sdc7
122880000
Windows:
wmic diskdrive
...stuff deleted... 122865120 ...
So for some reason the physical disk in Windows has less sectors than the Linux device? Do you know what is going on here?
When I then want to use LUKS/cryptsetup and create a /dev/mapper/crypt and pass that as iblock I cannot even format that disk using Windows (works perfectly with Linux as a qemu guest).
With Windows I get tons of errors in the host dmesg:
[ 3683.403467] bio error: 00000000f33a8dcd, err: 10
[ 3683.403612] bio error: 00000000a508ea6b, err: 10
[ 3683.414686] bio error: 00000000f06baf1d, err: 10
[ 3683.414767] bio error: 0000000035714712, err: 10
[ 3683.414829] bio error: 0000000062dd8892, err: 10
[ 3683.414883] bio error: 000000005c303a2d, err: 10
[ 3683.414936] bio error: 0000000024d02dea, err: 10
Any idea about that?
Regards Andreas
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 16
Hi all,
I reproduced this issue with kernel-5.9.16-200.fc33.x86_64 and qemu-kvm-5.1.0-8.fc33.x86_64, I tested on my laptop os.
For 1) test, detail steps as follows:
/usr/bin/qemu-kvm
-machine pc
-cpu host,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1000,hv_vpindex,hv_runtime,hv_synic,hv_reset
-bios /usr/share/seabios/bios.bin
-m 2048
-mem-prealloc
-smp 4,sockets=1,cores=4,threads=1
-uuid 15eb58c8-9272-393f-91f6-450effe1c07a
-no-user-config
-nodefaults
-rtc base=localtime
-boot menu=on
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4
-drive file=/home/win10-64.qcow2,format=qcow2,if=none,id=drive-virtio-disk0,cache=writeback
-device virtio-blk-pci,scsi=off,num-queues=4,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0,write-cache=on
-netdev tap,id=hostnet0,vhost=on
-device e1000,netdev=hostnet0,id=net0,mac=9a:7c:03:30:d6:8d,bus=pci.0,addr=0x3
-device VGA,bus=pci.0
-device vhost-scsi-pci,wwpn=naa.5001405b8504f669
-cdrom /mnt/windows/virtio-win-prewhql-0.1-196.iso
On latest RHEL8.4.0 host, there is not /vhost support in targetcli; On latest RHEL9 host, “targetcli /vhost create” will also hit “Could not create VhostFabricModule in configFS” error, I cannot find some way to solve this problem, so I have to use fedora to reproduce the issue. And with RHEL8/RHEL9 qemu-kvm version, under /usr/libexec/qemu-kvm --device help, I don’t find the vhost-scsi-pci device support~ @vrozenfe About this situation, if we need to file a new bug on Bugzilla to track this issue?
Thanks all~ Peixiu