Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1056408

Summary: thinly-provisioned fail to work for windows guest in Q35 machine type
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: hhuang, huding, juzhang, knoel, pbonzini, rbalakri, sluo, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1159740 (view as bug list) Environment:
Last Closed: 2014-11-04 17:56:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 1159740    

Description Sibiao Luo 2014-01-22 07:18:28 UTC
Description of problem:
thinly-provisioned testing in Q35 machine type is different from bug 1056379. so i file a new bug to trace it.

Version-Release number of selected component (if applicable):
host info:
3.10.0-76.el7.x86_64
qemu-kvm-1.5.3-38.el7.x86_64
seabios-1.7.2.2-10.el7.x86_64
seabios-bin-1.7.2.2-10.el7.x86_64
guest info:
win2012R2-64bit
virtio-win-prewhql-0.1-74

How reproducible:
100%

Steps to Reproduce:
1.modprobe a scsi_debug disk.
# modprobe scsi_debug lbpu=1 lbpws=1
# lsscsi
[0:0:0:0]    disk    ATA      ST3500413AS      HP64  /dev/sda 
[2:0:0:0]    cd/dvd  hp       DVD-RAM GH80N    RF01  /dev/sr0 
[19:0:0:0]   disk    Linux    scsi_debug       0004  /dev/sdb 
# qemu-img info /dev/sdb
image: /dev/sdb
file format: raw
virtual size: 8.0M (8388608 bytes)
disk size: 0

2.assign/passthroug it to windows guest and install virtio-win driver in guest.
e.g:# /usr/libexec/qemu-kvm -M q35 -cpu SandyBridge -enable-kvm...-drive file=/dev/sdb,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device virtio-scsi-pci,id=scsi1,bus=pcie.0,addr=0x7 -device *scsi-hd | scsi-block*,drive=drive-data-disk,id=data-disk,bus=scsi1.0

C:\Windows\System32> fsutil behavior query DisableDeleteNotify
DisableDeleteNotify = 0

3.install virtio-win driver, and cat the map.
# cat /sys/bus/pseudo/drivers/scsi_debug/map

4.initialize the disk and make file system (NTFS format) to the disk in the guest.

5.On the host side.
# cat /sys/bus/pseudo/drivers/scsi_debug/map

6.copy a file into the disk to take up the space in guest.

7.on host side.
# cat /sys/bus/pseudo/drivers/scsi_debug/map

8.remove the file in guest.

9.on host side.
# cat /sys/bus/pseudo/drivers/scsi_debug/map

Actual results:
#########for scsi-hd interface:
Cat /sys/bus/pseudo/drivers/scsi_debug/map values have no any changes after remove the file in step 8.

after step 2, boot up guest successfully.
after step 3, 
# cat /sys/bus/pseudo/drivers/scsi_debug/map
       <--------output nothing
after step 5, 
# cat /sys/bus/pseudo/drivers/scsi_debug/map
0,128-478,480-967,2432-2439,2944-2959,4840-11039,14335
after step 7, 
# cat /sys/bus/pseudo/drivers/scsi_debug/map
0,128-1061,1064-1224,1232-2165,2168-2305,2432-2439,2944-3797,3800-3960,3968-3985,3992-4161,4168-4174,4176-4193,4200-4400,4408-4425,4432-4609,4616-4633,4640-11973,11976-12813,12816-13749,13752-14327,14335
after step 9,
# cat /sys/bus/pseudo/drivers/scsi_debug/map
0,128-1061,1064-1224,1232-2165,2168-2305,2432-2439,2944-3797,3800-3960,3968-3985,3992-4161,4168-4174,4176-4193,4200-4400,4408-4425,4432-4609,4616-4633,4640-11973,11976-12813,12816-13749,13752-14327,14335

#########for scsi-block interface:
Cat /sys/bus/pseudo/drivers/scsi_debug/map values have no any changes after remove the file in step 8.

after step 2, boot up guest successfully.
after step 3, 
# cat /sys/bus/pseudo/drivers/scsi_debug/map
       <--------output nothing
after step 5, 
# cat /sys/bus/pseudo/drivers/scsi_debug/map
0,128-478,480-487,3512-8143,9088-9095,9600-9615,10367
after step 7, 
# cat /sys/bus/pseudo/drivers/scsi_debug/map
0,128-8143,9088-9095,9600-9615,10367
after step 9,
# cat /sys/bus/pseudo/drivers/scsi_debug/map
0,128-8143,9088-9095,9600-9615,10367

Expected results:
The thinly-provisioned work correctly in Q35 machine type.

Additional info:
# /usr/libexec/qemu-kvm -M q35 -cpu SandyBridge -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -name sluo -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,bus=pcie.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=org.qemu.guest_agent.0,bus=virtio-serial0.0,id=port1,nr=1 -drive file=/home/win2012r2-64.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0,bus=pcie.0,addr=0x4 -device scsi-hd,drive=drive-system-disk,id=system-disk,bus=scsi0.0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:01:02:B6:40:21,bus=pcie.0,addr=0x5 -device virtio-balloon-pci,id=ballooning,bus=pcie.0,addr=0x6 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -spice disable-ticketing,port=5931 -monitor stdio -drive file=/dev/sdb,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device virtio-scsi-pci,id=scsi1,bus=pcie.0,addr=0x7 -device scsi-hd,drive=drive-data-disk,id=data-disk,bus=scsi1.0

Comment 5 Paolo Bonzini 2014-11-04 17:56:21 UTC
Q35 will not be supported in RHEL/KVM.  Bug 1159740 was opened for qemu-kvm-rhev.