This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
Bug 2030104 - [virtio-win][vioscsi] System hang after system disk shrinked
Summary: [virtio-win][vioscsi] System hang after system disk shrinked
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: virtio-win
Version: 9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Vadim Rozenfeld
QA Contact: Peixiu Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-08 02:31 UTC by yimsong
Modified: 2023-08-16 13:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-16 13:56:08 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-1348 0 None None None 2023-08-16 13:56:08 UTC
Red Hat Issue Tracker RHELPLAN-105062 0 None None None 2021-12-08 02:38:22 UTC

Description yimsong 2021-12-08 02:31:34 UTC
Description of problem:
After changing disk size for sevral time, the vm can't reboot and need repaire.It shows "a required device isn't connected or can't be accessed". The error code is "0xc0000225"

Version-Release number of selected component (if applicable):
qemu-kvm-6.1.0-7.el9.x86_64
kernel-5.14.0-21.el9.x86_64
seabios-bin-1.14.0-7.el9.noarch
virtio-win-prewhql-0.1-215

How reproducible:
1/11

Steps to Reproduce:
1.boot up win8.1-64 guest with ovmf
system disk image size is 30G

2.Change disk size to 48318382080 in monitor and extend it in guest
{'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1', 'size': 48318382080}, 'id': 'R3EQ8hsW'}
 echo rescan > %TEMP%\rescan.dp && diskpart /s %TEMP%\rescan.dp
 echo select volume C > %TEMP%\extend_C.dp && echo extend >> %TEMP%\extend_C.dp && diskpart /s %TEMP%\extend_C.dp
3.reboot guest
4.do iozone test in guest
D:\Iozone\iozone.exe  -azR -r 64k -n 512M -g 1G -M -I -i 0 -i 1 -b iozone.xls -f C:\testfile

5.during io test,shrink disk size to 28991029248 in guest and qmp monitor
echo select volume C > %TEMP%\shrink_C.dp && echo shrink desired=18429 >> %TEMP%\shrink_C.dp && diskpart /s %TEMP%\shrink_C.dp
{'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1', 'size': 28991029248}, 'id': '241dL1sN'}
echo rescan > %TEMP%\rescan.dp && diskpart /s %TEMP%\rescan.dp

6.reboot guest

Actual results:
Guest can't boot up in step 6.

Expected results:
Guest can boot up.

Additional info:
1.qemu cmd line
MALLOC_PERTURB_=1  /usr/libexec/qemu-kvm \
    -S  \
    -name 'avocado-vt-vm1'  \
    -sandbox on  \
    -blockdev node-name=file_ovmf_code,driver=file,filename=/usr/share/OVMF/OVMF_CODE.secboot.fd,auto-read-only=on,discard=unmap \
    -blockdev node-name=drive_ovmf_code,driver=raw,read-only=on,file=file_ovmf_code \
    -blockdev node-name=file_ovmf_vars,driver=file,filename=/home/kvm_autotest_root/images/avocado-vt-vm1_win8-64.1-virtio-scsi.qcow2_VARS.fd,auto-read-only=on,discard=unmap \
    -blockdev node-name=drive_ovmf_vars,driver=raw,read-only=off,file=file_ovmf_vars \
    -machine q35,memory-backend=mem-machine_mem,pflash0=drive_ovmf_code,pflash1=drive_ovmf_vars \
    -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
    -device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
    -nodefaults \
    -device VGA,bus=pcie.0,addr=0x2 \
    -m 30720 \
    -object memory-backend-ram,size=30720M,id=mem-machine_mem  \
    -smp 10,maxcpus=10,cores=5,threads=1,dies=1,sockets=2  \
    -cpu 'Cascadelake-Server-noTSX',hv_stimer,hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,hv_ipi,+kvm_pv_unhalt \
    -chardev socket,wait=off,server=on,path=/tmp/avocado_2utjftr8/monitor-qmpmonitor1-20211205-094740-7i9oKDsf,id=qmp_id_qmpmonitor1  \
    -mon chardev=qmp_id_qmpmonitor1,mode=control \
    -chardev socket,wait=off,server=on,path=/tmp/avocado_2utjftr8/monitor-catch_monitor-20211205-094740-7i9oKDsf,id=qmp_id_catch_monitor  \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=idv0RWHX \
    -chardev socket,wait=off,server=on,path=/tmp/avocado_2utjftr8/serial-serial0-20211205-094740-7i9oKDsf,id=chardev_serial0 \
    -device isa-serial,id=serial0,chardev=chardev_serial0  \
    -chardev socket,id=seabioslog_id_20211205-094740-7i9oKDsf,path=/tmp/avocado_2utjftr8/seabios-20211205-094740-7i9oKDsf,server=on,wait=off \
    -device isa-debugcon,chardev=seabioslog_id_20211205-094740-7i9oKDsf,iobase=0x402 \
    -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
    -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
    -device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-2,addr=0x0 \
    -blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/win8-64.1-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
    -device scsi-hd,id=image1,drive=drive_image1,write-cache=on,serial=TARGET_DISK0 \
    -device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,chassis=4 \
    -device virtio-net-pci,mac=9a:63:fa:bd:99:9f,id=idwpSkhI,netdev=idX12nWA,bus=pcie-root-port-3,addr=0x0  \
    -netdev tap,id=idX12nWA,vhost=on,vhostfd=18,fd=5 \
    -blockdev node-name=file_cd1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/iso/windows/winutils.iso,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd1 \
    -device scsi-cd,id=cd1,drive=drive_cd1,write-cache=on  \
    -vnc :0  \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot menu=off,order=cdn,once=c,strict=off \
    -enable-kvm \
    -device pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,addr=0x3,chassis=5

Comment 3 Qianqian Zhu 2021-12-16 08:06:19 UTC
Hi Peixiu,

Would you help try if we can reproduce with RHEL guest? Seems 214 also reproduce this issue so might not be 215 regression.

Thanks,
Qianqian

Comment 4 Peixiu Hou 2021-12-17 07:00:38 UTC
(In reply to Qianqian Zhu from comment #3)
> Hi Peixiu,
> 
> Would you help try if we can reproduce with RHEL guest? Seems 214 also
> reproduce this issue so might not be 215 regression.
> 

Hi Qianqian,

This issue can be reproduced by manually, and it's not a 215 regression bz.

I did some tests as follows:
1) Tested with build 215 + ovmf, it can be reproduced.
2) Tested with build 214 + ovmf, also reproduced it.
3) Tested with build 215 + seabios, not reproduce it.

Versions:
kernel-5.14.0-21.el9.x86_64
qemu-kvm-6.1.0-5.el9.x86_64
virtio-win-prewhql-215
edk2-ovmf-20210527gite1999b264f1f-7.el9.noarch
seabios-bin-1.14.0-7.el9.noarch

Thanks~
Peixiu

> Thanks,
> Qianqian

Comment 6 Peixiu Hou 2021-12-17 07:16:29 UTC
Boot commands:

/usr/libexec/qemu-kvm \
    -name 'avocado-vt-vm1'  \
    -sandbox on  \
    -blockdev node-name=file_ovmf_code,driver=file,filename=/usr/share/OVMF/OVMF_CODE.secboot.fd,auto-read-only=on,discard=unmap \
    -blockdev node-name=drive_ovmf_code,driver=raw,read-only=on,file=file_ovmf_code \
    -blockdev node-name=file_ovmf_vars,driver=file,filename=/home/kvm_autotest_root/images/avocado-vt-vm1_win8-64.1-virtio-scsi.qcow2_VARS.fd,auto-read-only=on,discard=unmap \
    -blockdev node-name=drive_ovmf_vars,driver=raw,read-only=off,file=file_ovmf_vars \
    -machine q35,memory-backend=mem-machine_mem,pflash0=drive_ovmf_code,pflash1=drive_ovmf_vars \
    -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
    -device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
    -nodefaults \
    -device VGA,bus=pcie.0,addr=0x2 \
    -m 30720 \
    -object memory-backend-ram,size=30720M,id=mem-machine_mem  \
    -smp 32,maxcpus=32,cores=16,threads=1,dies=1,sockets=2  \
    -cpu 'EPYC-IBPB',x2apic=on,tsc-deadline=on,hypervisor=on,tsc-adjust=on,arch-capabilities=on,xsaves=on,cmp-legacy=on,perfctr-core=on,clzero=on,xsaveerptr=on,virt-ssbd=on,npt=on,nrip-save=on,svme-addr-chk=on,rdctl-no=on,skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,monitor=off,hv_stimer,hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,hv_ipi,kvm_pv_unhalt=on \
    -device pvpanic,ioport=0x505,id=idfAzXsl \
    -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
    -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
    -device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-2,addr=0x0 \
    -blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/win8-64.1-scsi-1.qcow2,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
    -device scsi-hd,id=image1,drive=drive_image1,write-cache=on,serial=TARGET_DISK0 \
    -device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,chassis=4 \
    -device virtio-net-pci,mac=9a:35:b8:6f:df:dc,id=idOVItJa,netdev=idWreQoo,bus=pcie-root-port-3,addr=0x0  \
    -netdev tap,id=idWreQoo,vhost=on \
    -blockdev node-name=file_cd1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/iso/windows/winutils.iso,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd1 \
    -device scsi-cd,id=cd1,drive=drive_cd1,write-cache=on  \
    -vnc :0  \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot menu=off,order=cdn,once=c,strict=off \
    -enable-kvm \
    -monitor stdio \
    -device vmcoreinfo \
    -qmp tcp:0:4445,server=on,wait=off \
    -cdrom /home/kvm_autotest_root/iso/windows/virtio-win-prewhql-0.1-214.iso \
    -device pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,addr=0x3,chassis=5

Comment 7 Vadim Rozenfeld 2022-04-26 06:53:21 UTC
I believe it is the timing issue. While resizing the disk (changing the disk geometry) is relatively fast operation 
The proper changing the volume size is taking a bit more time and efforts. While the disk enlargement operation is 
prety straightforward and almost doesn't require any action from the user side, the disk shrinking is a bit different.
Before running the resize command from the qemu monitor, the user needs to shrink the volume size to be same or even 
a bit less than it will be after resizing from the Disk Manager dialog inside of the guest, and only after that
issue the command from the qemu monitor. Please not that Windows might need a couple of seconds to trigger and handle 
the upcoming Unit Attention Condition properly.

Best,
Vadim.

Comment 8 Peixiu Hou 2022-05-12 09:11:09 UTC
Hi Vadim,

Hit this issue when do 218 vioscsi function tests on Win8.1-32, WIn10-32, WIn10-64 guests,
Tested with Q35 + seabios mode, qemu will report message "qemu-kvm: Desc next is 2" after do shink in qmp monitor, and the vm almost hang, cannot click any button in windows screen, just a pointer cycling and cycling~ wait about 30 mins, also cannot work.

Reproducible 100%

Used versions:
kernel-5.14.0-70.13.1.el9_0.x86_64
qemu-kvm-6.2.0-11.el9_0.2.x86_64
seabios-bin-1.15.0-1.el9.noarch
virtio-win-prewhql-218

Follows are detail reproduce steps:
1). Boot a vm up:
/usr/libexec/qemu-kvm \
    -name 'avocado-vt-vm1'  \
    -sandbox on  \
    -machine q35,memory-backend=mem-machine_mem \
    -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
    -device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
    -nodefaults \
    -device VGA,bus=pcie.0,addr=0x2 \
    -m 4096 \
    -object memory-backend-ram,size=4096M,id=mem-machine_mem  \
    -smp 8,maxcpus=8,cores=4,threads=1,dies=1,sockets=2  \
    -cpu 'EPYC-IBPB',x2apic=on,tsc-deadline=on,hypervisor=on,tsc-adjust=on,arch-capabilities=on,xsaves=on,cmp-legacy=on,perfctr-core=on,clzero=on,xsaveerptr=on,virt-ssbd=on,npt=on,nrip-save=on,svme-addr-chk=on,rdctl-no=on,skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,monitor=off,hv_stimer,hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,hv_ipi,kvm_pv_unhalt=on \
    -chardev socket,server=on,path=/tmp/monitor-qmpmonitor1-20220509-062858-1asG6lwV,wait=off,id=qmp_id_qmpmonitor1  \
    -mon chardev=qmp_id_qmpmonitor1,mode=control \
    -chardev socket,server=on,path=/tmp/monitor-catch_monitor-20220509-062858-1asG6lwV,wait=off,id=qmp_id_catch_monitor  \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=idmgOZwH \
    -chardev socket,server=on,path=/tmp/serial-serial0-20220509-062858-1asG6lwV,wait=off,id=chardev_serial0 \
    -device isa-serial,id=serial0,chardev=chardev_serial0  \
    -chardev socket,id=seabioslog_id_20220509-062858-1asG6lwV,path=/tmp/seabios-20220509-062858-1asG6lwV,server=on,wait=off \
    -device isa-debugcon,chardev=seabioslog_id_20220509-062858-1asG6lwV,iobase=0x402 \
    -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
    -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
    -device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,num_queues=8,bus=pcie-root-port-2,addr=0x0 \
    -blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/win10-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
    -device scsi-hd,id=image1,drive=drive_image1,write-cache=on,serial=TARGET_DISK0 \
    -device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,chassis=4 \
    -device virtio-net-pci,mac=9a:ff:1d:b6:14:b0,id=idg89zCo,netdev=idcDvQGB,bus=pcie-root-port-3,addr=0x0  \
    -netdev tap,id=idcDvQGB,vhost=on \
    -blockdev node-name=file_cd1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/iso/windows/winutils.iso,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd1 \
    -device scsi-cd,id=cd1,drive=drive_cd1,write-cache=on  \
    -vnc :1  \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot menu=off,order=cdn,once=c,strict=off \
    -enable-kvm \
    -monitor stdio \
    -device pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,addr=0x3,chassis=5

2) $ nc -U /tmp/monitor-qmpmonitor1-20220509-062858-1asG6lwV
{"QMP": {"version": {"qemu": {"micro": 0, "minor": 2, "major": 6}, "package": "qemu-kvm-6.2.0-11.el9_0.2"}, "capabilities": ["oob"]}}
{'execute': 'qmp_capabilities', 'id': 'ojR7GLxO'}
{"return": {}, "id": "ojR7GLxO"}

3) Enlarge the disk size to 50G.
{'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1', 'size': 51539607552}, 'id': '1notbL2p'}
{"return": {}, "id": "1notbL2p"}

4) Extend in the guest vm.
5) Shrink in the guest vm first. size to 23G.
6) Shrink system disk size to 30G in qmp_monitor(30G is larger than the system partition size 23G).
{'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1', 'size': 30923764224}, 'id': 'eySioVkL'}
Note the qemu monitor report a message:"qemu-kvm: Desc next is 2"

7) Did not return immediately, wait about 1 min, received "return":{}.
{"return": {}, "id": "eySioVkL"}

8) Check the vm system disk size, vm almost hang, cannot click any button in windows screen, just a pointer cycling and cycling~ and wait about 30 mins+, also does not work.

9) Do system_reset, the vm can be booted up and works normally.

And I download the vioscsi driver to virtio-win-prewhql-215 and virtio-win-1.9.17-4.el8_4.iso(vioscsi 199), both cannot reproduce this issue with seabios mode.

When tested with build 199, qemu will report follows warning:
"(qemu) qemu-kvm: warning: This feature depends on other features that were not requested: CPUID.8000000AH:EDX.npt [bit 0]
qemu-kvm: warning: This feature depends on other features that were not requested: CPUID.8000000AH:EDX.nrip-save [bit 3]
qemu-kvm: warning: This feature depends on other features that were not requested: CPUID.8000000AH:EDX.svme-addr-chk [bit 28]
...........
"

As above test results, it seems a regression, could you help to check?


Thanks~
Peixiu

Comment 9 Vadim Rozenfeld 2022-05-12 10:16:55 UTC
(In reply to Peixiu Hou from comment #8)
> Hi Vadim,
> 
> Hit this issue when do 218 vioscsi function tests on Win8.1-32, WIn10-32,
> WIn10-64 guests,
> Tested with Q35 + seabios mode, qemu will report message "qemu-kvm: Desc
> next is 2" after do shink in qmp monitor, and the vm almost hang, cannot
> click any button in windows screen, just a pointer cycling and cycling~ wait
> about 30 mins, also cannot work.
> 
> Reproducible 100%
> 
> Used versions:
> kernel-5.14.0-70.13.1.el9_0.x86_64
> qemu-kvm-6.2.0-11.el9_0.2.x86_64
> seabios-bin-1.15.0-1.el9.noarch
> virtio-win-prewhql-218
> 
> Follows are detail reproduce steps:
> 1). Boot a vm up:
> /usr/libexec/qemu-kvm \
>     -name 'avocado-vt-vm1'  \
>     -sandbox on  \
>     -machine q35,memory-backend=mem-machine_mem \
>     -device
> pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,
> chassis=1 \
>     -device
> pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
>     -nodefaults \
>     -device VGA,bus=pcie.0,addr=0x2 \
>     -m 4096 \
>     -object memory-backend-ram,size=4096M,id=mem-machine_mem  \
>     -smp 8,maxcpus=8,cores=4,threads=1,dies=1,sockets=2  \
>     -cpu
> 'EPYC-IBPB',x2apic=on,tsc-deadline=on,hypervisor=on,tsc-adjust=on,arch-
> capabilities=on,xsaves=on,cmp-legacy=on,perfctr-core=on,clzero=on,
> xsaveerptr=on,virt-ssbd=on,npt=on,nrip-save=on,svme-addr-chk=on,rdctl-no=on,
> skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,monitor=off,hv_stimer,
> hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,
> hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,
> hv_ipi,kvm_pv_unhalt=on \
>     -chardev
> socket,server=on,path=/tmp/monitor-qmpmonitor1-20220509-062858-1asG6lwV,
> wait=off,id=qmp_id_qmpmonitor1  \
>     -mon chardev=qmp_id_qmpmonitor1,mode=control \
>     -chardev
> socket,server=on,path=/tmp/monitor-catch_monitor-20220509-062858-1asG6lwV,
> wait=off,id=qmp_id_catch_monitor  \
>     -mon chardev=qmp_id_catch_monitor,mode=control \
>     -device pvpanic,ioport=0x505,id=idmgOZwH \
>     -chardev
> socket,server=on,path=/tmp/serial-serial0-20220509-062858-1asG6lwV,wait=off,
> id=chardev_serial0 \
>     -device isa-serial,id=serial0,chardev=chardev_serial0  \
>     -chardev
> socket,id=seabioslog_id_20220509-062858-1asG6lwV,path=/tmp/seabios-20220509-
> 062858-1asG6lwV,server=on,wait=off \
>     -device
> isa-debugcon,chardev=seabioslog_id_20220509-062858-1asG6lwV,iobase=0x402 \
>     -device
> pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,
> chassis=2 \
>     -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
>     -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
>     -device
> pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,
> chassis=3 \
>     -device
> virtio-scsi-pci,id=virtio_scsi_pci0,num_queues=8,bus=pcie-root-port-2,
> addr=0x0 \
>     -blockdev
> node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,
> aio=threads,filename=/home/kvm_autotest_root/images/win10-64-virtio-scsi.
> qcow2,cache.direct=on,cache.no-flush=off \
>     -blockdev
> node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-
> flush=off,file=file_image1 \
>     -device
> scsi-hd,id=image1,drive=drive_image1,write-cache=on,serial=TARGET_DISK0 \
>     -device
> pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,
> chassis=4 \
>     -device
> virtio-net-pci,mac=9a:ff:1d:b6:14:b0,id=idg89zCo,netdev=idcDvQGB,bus=pcie-
> root-port-3,addr=0x0  \
>     -netdev tap,id=idcDvQGB,vhost=on \
>     -blockdev
> node-name=file_cd1,driver=file,auto-read-only=on,discard=unmap,aio=threads,
> filename=/home/kvm_autotest_root/iso/windows/winutils.iso,cache.direct=on,
> cache.no-flush=off \
>     -blockdev
> node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-
> flush=off,file=file_cd1 \
>     -device scsi-cd,id=cd1,drive=drive_cd1,write-cache=on  \
>     -vnc :1  \
>     -rtc base=localtime,clock=host,driftfix=slew  \
>     -boot menu=off,order=cdn,once=c,strict=off \
>     -enable-kvm \
>     -monitor stdio \
>     -device
> pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,
> addr=0x3,chassis=5
> 
> 2) $ nc -U /tmp/monitor-qmpmonitor1-20220509-062858-1asG6lwV
> {"QMP": {"version": {"qemu": {"micro": 0, "minor": 2, "major": 6},
> "package": "qemu-kvm-6.2.0-11.el9_0.2"}, "capabilities": ["oob"]}}
> {'execute': 'qmp_capabilities', 'id': 'ojR7GLxO'}
> {"return": {}, "id": "ojR7GLxO"}
> 
> 3) Enlarge the disk size to 50G.
> {'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1',
> 'size': 51539607552}, 'id': '1notbL2p'}
> {"return": {}, "id": "1notbL2p"}
> 
> 4) Extend in the guest vm.
> 5) Shrink in the guest vm first. size to 23G.
> 6) Shrink system disk size to 30G in qmp_monitor(30G is larger than the
> system partition size 23G).
> {'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1',
> 'size': 30923764224}, 'id': 'eySioVkL'}
> Note the qemu monitor report a message:"qemu-kvm: Desc next is 2"
> 
> 7) Did not return immediately, wait about 1 min, received "return":{}.
> {"return": {}, "id": "eySioVkL"}
> 
> 8) Check the vm system disk size, vm almost hang, cannot click any button in
> windows screen, just a pointer cycling and cycling~ and wait about 30 mins+,
> also does not work.
> 
> 9) Do system_reset, the vm can be booted up and works normally.
> 
> And I download the vioscsi driver to virtio-win-prewhql-215 and
> virtio-win-1.9.17-4.el8_4.iso(vioscsi 199), both cannot reproduce this issue
> with seabios mode.
> 
> When tested with build 199, qemu will report follows warning:
> "(qemu) qemu-kvm: warning: This feature depends on other features that were
> not requested: CPUID.8000000AH:EDX.npt [bit 0]
> qemu-kvm: warning: This feature depends on other features that were not
> requested: CPUID.8000000AH:EDX.nrip-save [bit 3]
> qemu-kvm: warning: This feature depends on other features that were not
> requested: CPUID.8000000AH:EDX.svme-addr-chk [bit 28]
> ...........
> "
> 
> As above test results, it seems a regression, could you help to check?
> 
> 
> Thanks~
> Peixiu

Hi Peixiu,
Did you let Windows to shrink the disk before changing the disk size from
qemu side? (You need to run the "Disk Management" consol ->
right-click on the disk -> "Shrink Volume" -> "Enter the amount of space to
shrink in MB" to make the volume size a bit smaller than the actual size
after the disk resizing from the the qemu side. After that we can return to the
qemu monitor and shrink the volume. 
Please note that the above operation is only required for shrinking.
Windows doesn't require any special treatment in case of the disk enlargement.

Best,
Vadim.

Comment 10 Peixiu Hou 2022-06-08 09:45:26 UTC
(In reply to Vadim Rozenfeld from comment #9)
> (In reply to Peixiu Hou from comment #8)
> > Hi Vadim,
> > 
> > Hit this issue when do 218 vioscsi function tests on Win8.1-32, WIn10-32,
> > WIn10-64 guests,
> > Tested with Q35 + seabios mode, qemu will report message "qemu-kvm: Desc
> > next is 2" after do shink in qmp monitor, and the vm almost hang, cannot
> > click any button in windows screen, just a pointer cycling and cycling~ wait
> > about 30 mins, also cannot work.
> > 
> > Reproducible 100%
> > 
> > Used versions:
> > kernel-5.14.0-70.13.1.el9_0.x86_64
> > qemu-kvm-6.2.0-11.el9_0.2.x86_64
> > seabios-bin-1.15.0-1.el9.noarch
> > virtio-win-prewhql-218
> > 
> > Follows are detail reproduce steps:
> > 1). Boot a vm up:
> > /usr/libexec/qemu-kvm \
> >     -name 'avocado-vt-vm1'  \
> >     -sandbox on  \
> >     -machine q35,memory-backend=mem-machine_mem \
> >     -device
> > pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,
> > chassis=1 \
> >     -device
> > pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
> >     -nodefaults \
> >     -device VGA,bus=pcie.0,addr=0x2 \
> >     -m 4096 \
> >     -object memory-backend-ram,size=4096M,id=mem-machine_mem  \
> >     -smp 8,maxcpus=8,cores=4,threads=1,dies=1,sockets=2  \
> >     -cpu
> > 'EPYC-IBPB',x2apic=on,tsc-deadline=on,hypervisor=on,tsc-adjust=on,arch-
> > capabilities=on,xsaves=on,cmp-legacy=on,perfctr-core=on,clzero=on,
> > xsaveerptr=on,virt-ssbd=on,npt=on,nrip-save=on,svme-addr-chk=on,rdctl-no=on,
> > skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,monitor=off,hv_stimer,
> > hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,
> > hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,
> > hv_ipi,kvm_pv_unhalt=on \
> >     -chardev
> > socket,server=on,path=/tmp/monitor-qmpmonitor1-20220509-062858-1asG6lwV,
> > wait=off,id=qmp_id_qmpmonitor1  \
> >     -mon chardev=qmp_id_qmpmonitor1,mode=control \
> >     -chardev
> > socket,server=on,path=/tmp/monitor-catch_monitor-20220509-062858-1asG6lwV,
> > wait=off,id=qmp_id_catch_monitor  \
> >     -mon chardev=qmp_id_catch_monitor,mode=control \
> >     -device pvpanic,ioport=0x505,id=idmgOZwH \
> >     -chardev
> > socket,server=on,path=/tmp/serial-serial0-20220509-062858-1asG6lwV,wait=off,
> > id=chardev_serial0 \
> >     -device isa-serial,id=serial0,chardev=chardev_serial0  \
> >     -chardev
> > socket,id=seabioslog_id_20220509-062858-1asG6lwV,path=/tmp/seabios-20220509-
> > 062858-1asG6lwV,server=on,wait=off \
> >     -device
> > isa-debugcon,chardev=seabioslog_id_20220509-062858-1asG6lwV,iobase=0x402 \
> >     -device
> > pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,
> > chassis=2 \
> >     -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
> >     -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
> >     -device
> > pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,
> > chassis=3 \
> >     -device
> > virtio-scsi-pci,id=virtio_scsi_pci0,num_queues=8,bus=pcie-root-port-2,
> > addr=0x0 \
> >     -blockdev
> > node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,
> > aio=threads,filename=/home/kvm_autotest_root/images/win10-64-virtio-scsi.
> > qcow2,cache.direct=on,cache.no-flush=off \
> >     -blockdev
> > node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-
> > flush=off,file=file_image1 \
> >     -device
> > scsi-hd,id=image1,drive=drive_image1,write-cache=on,serial=TARGET_DISK0 \
> >     -device
> > pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,
> > chassis=4 \
> >     -device
> > virtio-net-pci,mac=9a:ff:1d:b6:14:b0,id=idg89zCo,netdev=idcDvQGB,bus=pcie-
> > root-port-3,addr=0x0  \
> >     -netdev tap,id=idcDvQGB,vhost=on \
> >     -blockdev
> > node-name=file_cd1,driver=file,auto-read-only=on,discard=unmap,aio=threads,
> > filename=/home/kvm_autotest_root/iso/windows/winutils.iso,cache.direct=on,
> > cache.no-flush=off \
> >     -blockdev
> > node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-
> > flush=off,file=file_cd1 \
> >     -device scsi-cd,id=cd1,drive=drive_cd1,write-cache=on  \
> >     -vnc :1  \
> >     -rtc base=localtime,clock=host,driftfix=slew  \
> >     -boot menu=off,order=cdn,once=c,strict=off \
> >     -enable-kvm \
> >     -monitor stdio \
> >     -device
> > pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,
> > addr=0x3,chassis=5
> > 
> > 2) $ nc -U /tmp/monitor-qmpmonitor1-20220509-062858-1asG6lwV
> > {"QMP": {"version": {"qemu": {"micro": 0, "minor": 2, "major": 6},
> > "package": "qemu-kvm-6.2.0-11.el9_0.2"}, "capabilities": ["oob"]}}
> > {'execute': 'qmp_capabilities', 'id': 'ojR7GLxO'}
> > {"return": {}, "id": "ojR7GLxO"}
> > 
> > 3) Enlarge the disk size to 50G.
> > {'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1',
> > 'size': 51539607552}, 'id': '1notbL2p'}
> > {"return": {}, "id": "1notbL2p"}
> > 
> > 4) Extend in the guest vm.
> > 5) Shrink in the guest vm first. size to 23G.
> > 6) Shrink system disk size to 30G in qmp_monitor(30G is larger than the
> > system partition size 23G).
> > {'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1',
> > 'size': 30923764224}, 'id': 'eySioVkL'}
> > Note the qemu monitor report a message:"qemu-kvm: Desc next is 2"
> > 
> > 7) Did not return immediately, wait about 1 min, received "return":{}.
> > {"return": {}, "id": "eySioVkL"}
> > 
> > 8) Check the vm system disk size, vm almost hang, cannot click any button in
> > windows screen, just a pointer cycling and cycling~ and wait about 30 mins+,
> > also does not work.
> > 
> > 9) Do system_reset, the vm can be booted up and works normally.
> > 
> > And I download the vioscsi driver to virtio-win-prewhql-215 and
> > virtio-win-1.9.17-4.el8_4.iso(vioscsi 199), both cannot reproduce this issue
> > with seabios mode.
> > 
> > When tested with build 199, qemu will report follows warning:
> > "(qemu) qemu-kvm: warning: This feature depends on other features that were
> > not requested: CPUID.8000000AH:EDX.npt [bit 0]
> > qemu-kvm: warning: This feature depends on other features that were not
> > requested: CPUID.8000000AH:EDX.nrip-save [bit 3]
> > qemu-kvm: warning: This feature depends on other features that were not
> > requested: CPUID.8000000AH:EDX.svme-addr-chk [bit 28]
> > ...........
> > "
> > 
> > As above test results, it seems a regression, could you help to check?
> > 
> > 
> > Thanks~
> > Peixiu
> 
> Hi Peixiu,
> Did you let Windows to shrink the disk before changing the disk size from
> qemu side? (You need to run the "Disk Management" consol ->
> right-click on the disk -> "Shrink Volume" -> "Enter the amount of space to
> shrink in MB" to make the volume size a bit smaller than the actual size
> after the disk resizing from the the qemu side. After that we can return to
> the
> qemu monitor and shrink the volume. 

Sorry, My response did not be saved before, yes, I'm sure I set the shrink step in guest before do qmp block_resize  commands.

After I shink in vm, the C system disk size is 23G, I block_resize target size is 30G, it's matched we requirement.

Thanks~
Peixiu
 
> Please note that the above operation is only required for shrinking.
> Windows doesn't require any special treatment in case of the disk
> enlargement.
> 


> Best,
> Vadim.

Comment 11 Peixiu Hou 2022-06-08 10:11:24 UTC
And Test with ovmf on WIn2012-64 vm, 100% reproduced this issue as comment#0.

steps as:
1. Boot a vm up.

2. {'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1', 'size': 51539607552}, 'id': 'EVBPjwan'}

3. echo select volume C > %TEMP%\extend_C.dp && echo extend >> %TEMP%\extend_C.dp && diskpart /s %TEMP%\extend_C.dp

4. wmic diskdrive get size, index
Index  Size         
0      51539604480

5. shutdown /r /f /t 0

6. D:\Iozone\iozone.exe  -azR -r 64k -n 512M -g 1G -M -I -i 0 -i 1 -b iozone.xls -f C:\testfile

7. echo select volume C > %TEMP%\shrink_C.dp && echo shrink desired=19660 >> %TEMP%\shrink_C.dp && diskpart /s %TEMP%\shrink_C.dp

8. {'execute': 'block_resize', 'arguments': {'node-name': 'drive_image1', 'size': 30923764224}, 'id': 'KL8LYE3N'}

9. wmic diskdrive get size, index
Index  Size         
0      30918827520

10. shutdown /r /f /t 0   --> issue occurr

Versions:
kernel-5.14.0-70.13.1.el9_0.x86_64
qemu-kvm-6.2.0-11.el9_0.2.x86_64
virtio-win-prewhql-221
edk2-ovmf-20220126gitbb1bba3d77-3.el9.noarch

Thanks~
Peixiu

Comment 26 Peixiu Hou 2023-07-18 09:09:57 UTC
This issue was reporoduced only on Win8.1-64 now, and since win8.1-64 was end of support from Jan 10, 2023. 
Based on the discussion with developer, closed as won't do that.

Any questions please feel free to let me know~

Thanks~
Peixiu

Comment 27 Peixiu Hou 2023-08-16 10:01:25 UTC
Hi Vadim,

I tried to add eventID=258 check, we can checked the ID 258 event, it shows "The storage optimizer successfully completed shrink on Windows (C:)". But also hit this issue when no block_resize in qmp, after this command was executed, qemu-kvm report "Desc next is 3" error, and guest hang, we send rescan command will timeout.

Details automation log as follows:

[stdlog] 2023-08-14 23:22:40,271 aexpect.client DEBUG| [10.73.73.177] Sending command: echo select volume C > %TEMP%\shrink_C.dp && echo shrink desired=99527 >> %TEMP%\shrink_C.dp && diskpart /s %TEMP%\shrink_C.dp
[stdlog] 2023-08-14 23:23:00,377 aexpect.client DEBUG| [10.73.73.177] Sending command: echo %errorlevel%
[stdlog] 2023-08-14 23:23:00,484 aexpect.client DEBUG| [10.73.73.177] Sending command: wevtutil qe Application /q:"*[System/EventID=258]" /f:text
[stdlog] 2023-08-14 23:23:00,938 aexpect.client DEBUG| [10.73.73.177] Sending command: echo %errorlevel%
[stdout] s, output is: 0
[stdout] Event[7]
[stdout]   Log Name: Application
[stdout]   Source: Microsoft-Windows-Defrag
[stdout]   Date: 2023-08-14T23:22:58.4170000Z
[stdout]   Event ID: 258
[stdout]   Task: N/A
[stdout]   Level: Information
[stdout]   Opcode: Info^@
[stdout]   Keyword: Classic^@
[stdout]   User: N/A
[stdout]   User Name: N/A
[stdout]   Computer: DESKTOP-D48HPLN
[stdout]   Description:
[stdout] The storage optimizer successfully completed shrink on Windows (C:)
[stdout]
[stdout]
[stdout]
[stdlog] 2023-08-14 23:23:01,046 avocado.test INFO | Context: Change disk size to 156551557632 in monitor
[stdlog] 2023-08-14 23:23:01,046 avocado.virttest.qemu_monitor DEBUG| (monitor avocado-vt-vm1.qmpmonitor1) Sending command 'block_resize'
[stdlog] 2023-08-14 23:23:01,047 avocado.virttest.qemu_monitor DEBUG| Send command: {"execute": "block_resize", "arguments": {"node-name": "drive_image1", "size": 156551557632}, "id": "yGWYqhOm"}
[stdlog] 2023-08-14 23:24:02,538 avocado.virttest.qemu_vm INFO | [qemu output] qemu-kvm: Desc next is 3
[stdlog] 2023-08-14 23:24:02,672 aexpect.client DEBUG| [10.73.73.177] Sending command: echo rescan > %TEMP%\rescan.dp && diskpart /s %TEMP%\rescan.dp
---->guest no response and rescan cmd timeout.

It's not 100% reproduced, sometimes passed result, I found no "qemu-kvm: Desc next is 3" error occur. May be this is a key point for this issue.

Anyway, based on this test result, I reopen this bug first.
Any questions please let me know, thanks~

BR~
Peixiu

Comment 30 RHEL Program Management 2023-08-16 13:20:01 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.


Note You need to log in before you can comment on or make changes to this bug.