[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH] Fix QEMU crash when taking multiples snapshots in
From: |
Benoît Canet |
Subject: |
[Qemu-stable] [PATCH] Fix QEMU crash when taking multiples snapshots in a row |
Date: |
Fri, 18 Apr 2014 15:44:18 +0200 |
Hello,
The following script to put in qemu/script/qmp can trigger a QEMU crash or a
freeze:
----
from qmp import QEMUMonitorProtocol
import time
client = QEMUMonitorProtocol(("127.0.0.1", 4444))
client.connect()
for i in range(1200):
name = "blub_%i.qcow2" % i
args = { "actions": [ { 'type': 'blockdev-snapshot-sync', 'data' : {
"device": "virtio0", "snapshot-file": name } } ] }
# time.sleep(1)
print client.cmd("transaction", args)
----
If the script is launched as it is it will lead to a QEMU crash after around 80
snapshots.
If you uncomment the 1 second delay between the qmp snapshots it will lead to a
QEMU freeze.
$User seems to be impacted by this bug on VMs having huge backing file chains.
(hundreds of snapshots).
gdb and valgrind not being very useful to troubleshoot the bug (coroutine
voodoo)
I used git bisect which gave commit: ba2ab2f2ca4150a7e314fbb19fa158bd8ddc36eb.
Having seen in gdb when compiling with --disable-coroutine-pool that the
backtrace
was comporting a lot of frames talking about bdrv_unref before crashing into
qcow2_close it was clear that the BDRV_O_NO_BACKING was missing from commit
ba2ab2f2ca4150a7e314fbb19fa158bd8ddc36eb.
This patch backports commit c9fbb99d41b05acf0d7b93deb2fcdbf9047c238e to 1.7.1.
This patch prevent the qmp script from crashing or freezing QEMU.
(I used the script to take 502 snapshots before hitting the max fd limit)
Best regards
Benoît
Kevin Wolf (1):
block: Use BDRV_O_NO_BACKING where appropriate
block.c | 4 ++--
block/qcow2.c | 3 ++-
block/vmdk.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
--
1.7.10.4
- [Qemu-stable] [PATCH] Fix QEMU crash when taking multiples snapshots in a row,
Benoît Canet <=