RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 828047 - QEMU core dump and the guest hang when online shrink the virtio-scsi data image size
Summary: QEMU core dump and the guest hang when online shrink the virtio-scsi data ima...
Keywords:
Status: CLOSED DUPLICATE of bug 808664
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.3
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 833566
TreeView+ depends on / blocked
 
Reported: 2012-06-04 06:48 UTC by Sibiao Luo
Modified: 2012-07-17 08:04 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-17 08:04:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sibiao Luo 2012-06-04 06:48:19 UTC
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 07:11:36 UTC
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 08:04:46 UTC
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.