Bug 845462 - shoud not hotplug not exist virtio storage on qemu
Summary: shoud not hotplug not exist virtio storage on qemu
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kvm
Version: 5.9
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-03 07:12 UTC by langfang
Modified: 2012-08-12 07:52 UTC (History)
9 users (show)

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


Attachments (Terms of Use)

Description langfang 2012-08-03 07:12:43 UTC
Description of problem:

should not hotplug a not exist img to guest .

Version-Release number of selected component (if applicable):
host:
# uname -r
2.6.18-333.el5
#rpm -q kvm
kvm-83-258.el5
 
guest:
# uname -r
2.6.18-333.el5

How reproducible:
100%

Steps to Reproduce:
1.boot guest 
CLI:/usr/libexec/qemu-kvm -m 2G -smp 2 -cpu qemu64,+sse2 -drive file=/home/111.raw,format=raw,media=disk,if=virtio,cache=none,werror=stop,boot=on -net nic,model=virtio,macaddr=04:24:21:78:B7:97,vlan=0 -net tap,sndbuf=0,vlan=0,script=/etc/qemu-ifup,downscript=no -uuid 52879ba5-6819-47f4-8bb5-851043730461 -vnc :10 -boot nc -usbdevice tablet -no-hpet -rtc-td-hack -no-kvm-pit-reinjection -monitor stdio  -boot c -balloon virtio  -drive file=/dev/cdrom,media=cdrom,if=ide -drive file=/home/floppy.img,if=floppy -drive file=/tmp/test.img,media=disk,if=virtio,cache=off,format=raw,werror=stop


(qemu)info block
virtio0: type=hd removable=0 file=/home/111.raw ro=0 drv=raw encrypted=0
ide0-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_device encrypted=0
floppy0: type=floppy removable=1 locked=0 file=/home/floppy.img ro=0 drv=raw encrypted=0
virtio1: type=hd removable=0 file=/tmp/test.img ro=0 drv=raw encrypted=0
ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]
sd0: type=floppy removable=1 locked=0 [not inserted]

2.hotplug another not exist virtio storage to guest 
(qemu)pci_add pci_addr=auto storage file=/home/img-copy1.qcow2,if=virtio
qemu: could not open disk image /home/img-copy1.qcow2
failed to add file=/home/img-copy1.qcow2,if=virtio


3.results:
(qemu) info block
virtio0: type=hd removable=0 file=/home/111.raw ro=0 drv=raw encrypted=0
ide0-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_device encrypted=0
floppy0: type=floppy removable=1 locked=0 file=/home/floppy.img ro=0 drv=raw encrypted=0
virtio1: type=hd removable=0 file=/tmp/test.img ro=0 drv=raw encrypted=0
ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]
sd0: type=floppy removable=1 locked=0 [not inserted]
virtio2: type=hd removable=0 [not inserted]

  
Actual results:
add virtio storage "virtio2",but in guest run " #fdisk -l ",can not see this blk

Expected results:

when add not exist img ,will report error like above ,but not add in qemu

Additional info:

Comment 1 langfang 2012-08-08 08:18:28 UTC
test the steps as same as description:

hotplug not exitst file about 30 times on qemu:

(qemu)pci_add pci_addr=auto storage file=/home/2222.img,if=virtio


results:

(qemu) pci_add pci_addr=auto storage file=/home/2222.img,if=virtio
qemu: could not open disk image /home/2222.img
failed to add file=/home/2222.img,if=virtio
(qemu) 
Program received signal SIGSEGV, Segmentation fault.
qemu_get_clock (clock=0x8200000001) at /usr/src/debug/kvm-83-maint-snapshot-20090205/qemu/vl.c:1310
1310	    switch(clock->type) {
(gdb) bt
#0  qemu_get_clock (clock=0x8200000001) at /usr/src/debug/kvm-83-maint-snapshot-20090205/qemu/vl.c:1310
#1  0x0000000000409505 in main_loop_wait (timeout=<value optimized out>) at /usr/src/debug/kvm-83-maint-snapshot-20090205/qemu/vl.c:4134
#2  0x00000000005013ca in kvm_main_loop () at /usr/src/debug/kvm-83-maint-snapshot-20090205/qemu/qemu-kvm.c:596
#3  0x000000000040e747 in main_loop (argc=32, argv=0x7fffffffe718, envp=<value optimized out>) at /usr/src/debug/kvm-83-maint-snapshot-20090205/qemu/vl.c:4157
#4  main (argc=32, argv=0x7fffffffe718, envp=<value optimized out>) at /usr/src/debug/kvm-83-maint-snapshot-20090205/qemu/vl.c:6559
(gdb)

Comment 2 langfang 2012-08-08 08:52:57 UTC
test this probelm on rhel6.3 host

host:
# uname -r
2.6.32-288.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.299.el6.x86_64

guest:
# uname -r
2.6.18-333.el5


1.boot a guest
2.hotplug a non-exist file 
(qemu)info block
drive-ide0-0-0: removable=0 io-status=ok file=/mnt/111.raw ro=0 drv=raw encrypted=0
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]
(qemu)__com.redhat_drive_add file=/root/rhel6.4,id=test1
could not open disk image /root/rhel6.4: No such file or directory
Device 'test1' could not be initialized
(qemu) info block
drive-ide0-0-0: removable=0 io-status=ok file=/mnt/111.raw ro=0 drv=raw encrypted=0
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]



results:when hotplug a non-exist file ,the give friendly tip,and also not add on qemu.

Comment 3 Ronen Hod 2012-08-08 17:56:34 UTC
Closing as WONTFIX.
- Most, if not all, our customers use RHEV, or their own management software, so they do not run into these situations.
- There is no crash or data corruption, hence there is no real damage.
- We will wait for a customer report.
Thanks, Ronen.

Comment 4 Suqin Huang 2012-08-10 07:17:24 UTC
(In reply to comment #3)
> Closing as WONTFIX.
> - Most, if not all, our customers use RHEV, or their own management
> software, so they do not run into these situations.
> - There is no crash or data corruption, hence there is no real damage.


Hi ronen,

guest will reboot when hotplug more than 30 non-existing disk.

it make this bug more serious

Thanks
Suqin


> - We will wait for a customer report.
> Thanks, Ronen.


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