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 1314248 - System crashed when mirroring to itself
Summary: System crashed when mirroring to itself
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.8
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: John Snow
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1359965
TreeView+ depends on / blocked
 
Reported: 2016-03-03 09:44 UTC by jingzhao
Modified: 2016-12-02 21:07 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-02 21:07:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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

Version-Release number of selected component (if applicable):
kernel-2.6.32-620.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.489.el6.x86_64

How reproducible:
3/3

Steps to Reproduce:
1.Boot vm through following cli:
/usr/libexec/qemu-kvm \
-name rhel6.6.0 \
-machine rhel6.6.0,accel=kvm \
-realtime mlock=off \
-cpu SandyBridge \
-m 4G   \
-smp 4,cores=1,threads=1,sockets=4  \
-uuid 49a3438a-70a3-4ba8-92ce-3a05e0934608 \
-nodefaults \
-rtc base=utc,driftfix=slew \
-monitor unix:/tmp/monitor-unix,server,nowait \
-serial unix:/tmp/serial0,server,nowait \
-global kvm-pit.lost_tick_policy=discard \
-global PIIX4_PM.disable_s3=1 \
-global PIIX4_PM.disable_s4=1 \
-boot order=c,menu=on,strict=on \
-device virtio-scsi-pci,id=scsi \
-drive file=/home/0223/rhel68bk2.qcow2,if=none,format=qcow2,id=drive-virtio-scsi,werror=stop,rerror=stop \
-device scsi-hd,drive=drive-virtio-scsi,id=virtio-scsi,bus=scsi.0,scsi-id=0 \
-netdev tap,id=hostnet0,vhost=on \
-device virtio-net-pci,netdev=hostnet0,id=net0,vectors=0,mac=00:1a:4a:42:0a:00 \
-monitor stdio \
-qmp tcp:0:4466,server,nowait -serial unix:/tmp/ttym,server,nowait \
-vga qxl \
-spice port=5910,password=redhat-vga,disable-ticketing \
-k en-us \

2. In qmp, mirroring the base to itself
{ "execute": "drive-mirror", "arguments": { "device": "drive-virtio-disk0", "target": "/home/rhelbk2.img","sync": "full"}}
{ "execute": "__com.redhat_drive-reopen", "arguments": {"device": "drive-virtio-scsi", "new-image-file": "/home/rhelbk2.img" } 

3.restart the guest or restart the guest before "drive-reopen"

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


Expected results:
system boot up correctly


Additional info:

Comment 3 John Snow 2016-05-12 18:20:36 UTC
Is the report correct?

...
-drive file=/home/0223/rhel68bk2.qcow2,if=none,format=qcow2,id=drive-virtio-scsi,werror=stop,rerror=stop \
...

{ "execute": "drive-mirror", "arguments": { "device": "drive-virtio-disk0", "target": "/home/rhelbk2.img","sync": "full"}}
{ "execute": "__com.redhat_drive-reopen", "arguments": {"device": "drive-virtio-scsi", "new-image-file": "/home/rhelbk2.img" } 


You create a drive of id=drive-virtio-scsi, but then reference a drive named "drive-virtio-disk0" with drive-mirror.

Did you mean to write "drive-virtio-scsi" here?

Comment 4 jingzhao 2016-05-13 08:32:48 UTC
(In reply to John Snow from comment #3)
> Is the report correct?
> 
> ...
> -drive
> file=/home/0223/rhel68bk2.qcow2,if=none,format=qcow2,id=drive-virtio-scsi,
> werror=stop,rerror=stop \
> ...
> 
> { "execute": "drive-mirror", "arguments": { "device": "drive-virtio-disk0",
> "target": "/home/rhelbk2.img","sync": "full"}}
> { "execute": "__com.redhat_drive-reopen", "arguments": {"device":
> "drive-virtio-scsi", "new-image-file": "/home/rhelbk2.img" } 
> 
> 
> You create a drive of id=drive-virtio-scsi, but then reference a drive named
> "drive-virtio-disk0" with drive-mirror.
> 
> Did you mean to write "drive-virtio-scsi" here?

Sorry for the mistake, yes, I mean write to "drive-virtio-scsi"

Thanks
Jing

Comment 5 John Snow 2016-12-02 21:07:49 UTC
Actually, I think this is not valid.

Why would you mirror a drive to itself? This to me is like the famous "cat file > file" problem. You may expect this does nothing, but in fact it erases the file.

It looks like the same problem is happening here, and I think the real solution is "well, don't do that."

If I am mistaken and there is some genuine use case for trying to overwrite a file that is open with data from that open file... well, let me know about that.


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