Bug 828047 - QEMU core dump and the guest hang when online shrink the virtio-scsi data image size
QEMU core dump and the guest hang when online shrink the virtio-scsi data ima...
Status: CLOSED DUPLICATE of bug 808664
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.3
x86_64 Linux
medium Severity high
: rc
: ---
Assigned To: Paolo Bonzini
Virtualization Bugs
:
Depends On:
Blocks: 833566
  Show dependency treegraph
 
Reported: 2012-06-04 02:48 EDT by Sibiao Luo
Modified: 2012-07-17 04:04 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-17 04:04:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sibiao Luo 2012-06-04 02:48:19 EDT
Description of problem:
create a raw format data disk and boot a guest with the virtio-scsi data disk,
QEMU core dump and the guest hang when online shrink the virtio-scsi data image size. I have tested the enlarge the size of raw/qcow2 disk successfully, currently, the qcow2 format only support the online enlarge disk size, if raw format cann't support the online shrink, the QEMU should give a prompt, such as "this feature or command is not currently supported", but core dump is not acceptable.

Version-Release number of selected component (if applicable):
hsot info:
# uname -r && rpm -q qemu-kvm-rhev
2.6.32-274.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.295.el6.x86_64
guest info:
guest name: RHEL-6.3-Snapshot-5-20120523.1-x86_64
# uname -r
2.6.32-274.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.create a RAW format data disk and check the info.
# qemu-img create -f raw my_data_disk.raw 10G
Formatting 'my_data_disk.raw', fmt=raw size=10737418240 
# qemu-img info my_data_disk.raw
image: my_data_disk.raw
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 0
2.boot the guest with the virtio-scsi data disk.
eg:<qemu-kvm-command>-drive file=/home/my_data_disk.raw,format=raw,if=none,cache=none,id=sluo_drive,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi1 -device scsi-hd,drive=sluo_drive,bus=scsi1.0,id=sluo_image
3.shrink the virtio-scsi data disk size.
(qemu) block_resize sluo_drive 5G
4.check the data disk image info via qemu-img.
# qemu-img info my_data_disk.raw

Actual results:
after the step 3, the guest hang and the QEMU core dump,
(qemu) block_resize sluo_drive 5G
(qemu) block I/O error in device 'sluo_drive': Input/output error (5)
(qemu) info status 
VM status: paused (io-error)
(qemu) cont
(qemu) qemu-kvm: /builddir/build/BUILD/qemu-kvm-0.12.1.2/hw/scsi-disk.c:252: scsi_read_data: Assertion `r->req.aiocb == ((void *)0)' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff57768a5 in raise () from /lib64/libc.so.6

(gdb) bt
#0  0x00007ffff57768a5 in raise () from /lib64/libc.so.6
#1  0x00007ffff5778085 in abort () from /lib64/libc.so.6
#2  0x00007ffff576fa1e in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff576fae0 in __assert_fail () from /lib64/libc.so.6
#4  0x00007ffff7e5efc7 in scsi_read_data (req=0x7fffdfffa5c0) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/scsi-disk.c:252
#5  0x00007ffff7e5e246 in scsi_dma_restart_bh (opaque=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/scsi-bus.c:53
#6  0x00007ffff7e1ccd1 in qemu_bh_poll () at async.c:70
#7  0x00007ffff7dea6c9 in main_loop_wait (timeout=1000) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4032
#8  0x00007ffff7e0bdfa in kvm_main_loop () at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:2244
#9  0x00007ffff7ded09c in main_loop (argc=20, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4202
#10 main (argc=20, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:6427
(gdb)

after the step 4,
# qemu-img info my_data_disk.raw
image: my_data_disk.raw
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 0

Expected results:
the data image size was shrink to 5.0G successfully, both the guest and host work correctly.

Additional info:
the command line as following,
# /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu SandyBridge -enable-kvm -smp 2 -m 2G -usb -device usb-tablet,id=input0 -name test_sluo -uuid `uuidgen` -drive file=/home/RHEL-6.3-Snapshot-5-20120523.1-x86_64.qcow2,if=none,id=scsi-drive,format=qcow2,aio=native,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0 -device scsi-hd,drive=scsi-drive,scsi-id=0,lun=0,bus=scsi0.0,id=scsi_image,bootindex=1 -netdev tap,script=/etc/qemu-ifup,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -vnc :1 -balloon none -device sga -chardev socket,id=serial0,path=/var/sluo,server,nowait -device isa-serial,chardev=serial0 -monitor unix:/tmp/monitor2,server,nowait -monitor stdio -qmp tcp:0:4444,server,nowait -drive file=/home/my_data_disk.raw,format=raw,if=none,cache=none,id=sluo_drive,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi1 -device scsi-hd,drive=sluo_drive,bus=scsi1.0,id=sluo_image
Comment 1 juzhang 2012-06-04 03:11:36 EDT
FYI
Seems duplicated to Bug 808664 - With virtio-scsi disk guest can't resume form "No space left on device"

--snip logs from bz808664---
(qemu) qemu-kvm: /builddir/build/BUILD/qemu-kvm-0.12.1.2/hw/scsi-disk.c:369: scsi_write_data: Assertion `r->req.aiocb == ((void *)0)' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff57788a5 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff57788a5 in raise () from /lib64/libc.so.6
#1  0x00007ffff577a085 in abort () from /lib64/libc.so.6
#2  0x00007ffff5771a1e in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff5771ae0 in __assert_fail () from /lib64/libc.so.6
#4  0x00007ffff7e5e901 in scsi_write_data (req=0x7fffdc0fd990) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/scsi-disk.c:369
#5  0x00007ffff7e5def6 in scsi_dma_restart_bh (opaque=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/scsi-bus.c:53
#6  0x00007ffff7e1d741 in qemu_bh_poll () at async.c:70
#7  0x00007ffff7deb2c9 in main_loop_wait (timeout=1000) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4032
#8  0x00007ffff7e0c86a in kvm_main_loop () at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:2244
#9  0x00007ffff7dedc9c in main_loop (argc=20, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4202
#10 main (argc=20, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:6427
Comment 2 Paolo Bonzini 2012-07-17 04:04:46 EDT
Same backtrace as bug 808664, closing as duplicate.  block_resize will be tested by QE as soon as it is ready (bug 808660).

*** This bug has been marked as a duplicate of bug 808664 ***

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