Bug 1314250

Summary: System crashed when mirroring to itself
Product: Red Hat Enterprise Linux 7 Reporter: jingzhao <jinzhao>
Component: qemu-kvm-rhevAssignee: John Snow <jsnow>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: chayang, huding, juzhang, knoel, kwolf, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-27 20:26:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jingzhao 2016-03-03 09:47:40 UTC
Description of problem:
System crashed when mirroring to itself

Version-Release number of selected component (if applicable):
kernel-3.10.0-350.el7.x86_64
qemu-kvm-rhev-2.3.0-31.el7_2.8.x86_64

How reproducible:
3/3

Steps to Reproduce:
1.Boot vm through following cli:
/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge \
-nodefaults -rtc base=utc \
-m 4G \
-smp 2,sockets=2,cores=1,threads=1 \
-enable-kvm \
-name rhel7 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-monitor stdio \
-serial unix:/tmp/serial0,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-vga std \
-vnc :0 \
-drive file=/home/rhelbk2.img,if=none,id=drive-virtio-disk0,format=raw,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \
-netdev tap,id=hostnet1,vhost=on \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=54:52:00:B6:40:22 \
-qmp tcp::8887,server,nowait \


2. In qmp, mirroring the base to itself
{ "execute": "drive-mirror", "arguments": { "device": "drive-virtio-disk0", "target": "/home/rhelbk2.img","sync": "full"}}
{"execute": "block-job-complete", "arguments": { "device": "drive-virtio-disk0"} } 

3.restart the guest "

Actual results:
System crashed and the guest didn't boot up


Expected results:
system boot up correctly

Additional info:

Comment 2 John Snow 2016-05-20 18:08:07 UTC
Kevin, I *think* this is not currently possible to check (if a filename is already opened within QEMU) without some future work from you and Fam, right?

I'm leaning towards postponing this to some future date -- it'd be nice to guard against it, but you can't guard against everything...

--js

Comment 3 Kevin Wolf 2016-05-27 17:41:07 UTC
Yes, I think it's a case of "then don't do that". Or in other words NOTABUG.

Even in the future, we won't be able to tell whether two paths refer to the
same image. We could in theory check a few obvious cases like exactly the same
filename, but it already gets tricky with links. And as soon as a network
protocol is involved, you can't tell anything any more. So telling the user to
be careful is probably the most consistent solution.

Comment 4 John Snow 2016-05-27 20:26:29 UTC
And there we have it.

This is not possible to consistently guard against now or even in the future, so "please don't do that." 

Thanks jingzhao and Kevin.