Bug 595974
Summary: | users should get an error message when tired to use one drive for two or more devices via device_add command. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | juzhang <juzhang> |
Component: | qemu-kvm | Assignee: | Markus Armbruster <armbru> |
Status: | CLOSED NEXTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 6.0 | CC: | amit.shah, kraxel, llim, michen, tburke, virt-maint |
Target Milestone: | beta | ||
Target Release: | 6.1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-02-16 13:29:17 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 580953 |
Description
juzhang
2010-05-26 03:04:29 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux major release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Major release. This request is not yet committed for inclusion. Markus, wanna take this? I think your blockdev patches cover this anyway ... They do. Taking the bug. Tested on qemu-kvm-0.12.1.2-2.91.el6.x86_64. 1. boot guest /usr/libexec/qemu-kvm -m 2G -smp 2 -drive file=/root/zhangjunyi/winxp_32.raw,if=none,id=test,boot=on,cache=none,format=raw -device ide-drive,drive=test -cpu qemu64,+sse2,+x2apic -monitor stdio -boot order=cdn,menu=on -netdev tap,id=hostnet0,vhost=on -device rtl8139,netdev=hostnet0,id=net0,mac=22:11:22:45:66:97 -vnc :10 -qmp tcp:0:4445,server,nowait 2. telnet the qmp server and issue qmp_capabilites #{"execute":"qmp_capabilities"} 3.hot add driver,id=test1 #{"execute":"__com.redhat_drive_add", "arguments": {"file":"/root/zhangjunyi/test1.qcow2","format":"qcow2","id":"test1"}} 4.hot add device using test1 driver #{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"test1","id":"zhang"}} 5.hot add another device using same test1 driver {"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"test1","id":"zhang2"}} 6.hot del drive zhang { "execute": "device_del", "arguments": { "id": "zhang"}} 7. hot del drive zhang2 Results: After step7,qemu-kvm was abort because of Segmentation fault gdb) bt #0 bdrv_delete (bs=0x0) at block.c:652 #1 0x000000000040ec75 in drive_uninit (dinfo=0x1280730) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:2127 #2 0x000000000042c0f8 in virtio_blk_exit_pci (pci_dev=0x1b58300) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/virtio-pci.c:602 #3 0x00000000004211d0 in pci_unregister_device (dev=0x1b58300) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/pci.c:729 #4 0x000000000050ea51 in qdev_free (dev=0x1b58300) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/qdev.c:334 #5 0x000000000048fb01 in pciej_write (opaque=<value optimized out>, addr=<value optimized out>, val=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/acpi.c:752 #6 0x00000000004e1afc in ioport_write (addr=<value optimized out>, val=<value optimized out>) at ioport.c:80 #7 cpu_outl (addr=<value optimized out>, val=<value optimized out>) at ioport.c:210 #8 0x0000000000439288 in kvm_handle_io (env=0x1091f60) at /usr/src/debug/qemu-kvm-0.12.1.2/kvm-all.c:541 #9 kvm_run (env=0x1091f60) at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:975 #10 0x00000000004393e1 in kvm_cpu_exec (env=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:1658 #11 0x000000000043a551 in kvm_main_loop_cpu (_env=0x1091f60) at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:1900 #12 ap_main_loop (_env=0x1091f60) at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:1950 #13 0x00000033d26077e1 in start_thread () from /lib64/libpthread.so.0 #14 0x00000033d1ee151d in clone () from /lib64/libc.so.6 Would you please tell me is same issue or consequence of this issue?if not same issue,please let me know,i will open a new bug. I'm pretty sure it is. If a device uses a drive, device_del deletes the drive along with the device. In your test case, devices "zhang" and "zhang2" both use drive "test1". That's bad, and this bz is about preventing it. Step 6 deletes "zhang" and "test1". This leaves a dangling drive reference in device "zhang2". Step 7 deletes "zhang2" and (again) "test1". The latter crashes. (In reply to comment #7) > I'm pretty sure it is. > > If a device uses a drive, device_del deletes the drive along with the device. > > In your test case, devices "zhang" and "zhang2" both use drive "test1". That's > bad, and this bz is about preventing it. > > Step 6 deletes "zhang" and "test1". This leaves a dangling drive reference in > device "zhang2". > > Step 7 deletes "zhang2" and (again) "test1". The latter crashes. Got it,Thanks for your confirmation I believe this has been fixed by the patch for bug 654682, which went into qemu-kvm-0.12.1.2-2.142.el6. Could you please verify? Thanks! (In reply to comment #10) > I believe this has been fixed by the patch for bug 654682, which went into > qemu-kvm-0.12.1.2-2.142.el6. Could you please verify? Thanks! Tested on qemu-kvm-0.12.1.2-2.144.el6 using the steps as same as comment6. After step5, {"error": {"class": "PropertyValueInUse", "desc": "Property 'virtio-blk-pci.drive' can't take value 'test1', it's in use", "data": {"device": "virtio-blk-pci", "property": "drive", "value": "test1"}}} Hi,Markus after step5,qemu-kvm prevent another device attach this driver,so,I think this bug has been fixed.what's your opinion? Best Regards, Junyi Your test case looks good, and the error you get in step 5 is what I expect. |