[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 023/156] block: Use BDRV_O_NO_BACKING where appropri
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 023/156] block: Use BDRV_O_NO_BACKING where appropriate |
Date: |
Tue, 8 Jul 2014 12:16:54 -0500 |
From: Kevin Wolf <address@hidden>
If you open an image temporarily just because you want to check its size
or get it flushed, there's no real reason to open the whole backing file
chain.
This is a backport of c9fbb99d41b05acf0d7b93deb2fcdbf9047c238e to
qemu 1.7.1.
The backport was done to fix a bug where QEMU 1.7.1 would crash or freeze
when the user take around 80 consecutives snapshots in a row.
git bisect would lead to commit: ba2ab2f2ca4150a7e314fbb19fa158bd8ddc36eb
and it was clear that BDRV_NO_BACKING was missing.
Signed-off-by: Kevin Wolf <address@hidden>
Signed-off-by: Benoit Canet <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
---
block.c | 4 ++--
block/qcow2.c | 3 ++-
block/vmdk.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index 8f84dbc..68651a9 100644
--- a/block.c
+++ b/block.c
@@ -1067,9 +1067,9 @@ int bdrv_open(BlockDriverState *bs, const char *filename,
QDict *options,
/* if snapshot, we create a temporary backing file and open it
instead of opening 'filename' directly */
- /* if there is a backing file, use it */
bs1 = bdrv_new("");
- ret = bdrv_open(bs1, filename, NULL, 0, drv, &local_err);
+ ret = bdrv_open(bs1, filename, NULL, BDRV_O_NO_BACKING, drv,
+ &local_err);
if (ret < 0) {
bdrv_unref(bs1);
goto fail;
diff --git a/block/qcow2.c b/block/qcow2.c
index b43c7d0..f2897b6 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1605,7 +1605,8 @@ static int qcow2_create2(const char *filename, int64_t
total_size,
/* Reopen the image without BDRV_O_NO_FLUSH to flush it before returning */
ret = bdrv_open(bs, filename, NULL,
- BDRV_O_RDWR | BDRV_O_CACHE_WB, drv, &local_err);
+ BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_BACKING,
+ drv, &local_err);
if (error_is_set(&local_err)) {
error_propagate(errp, local_err);
goto out;
diff --git a/block/vmdk.c b/block/vmdk.c
index a7ebd0f..d35a9d7 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1689,7 +1689,7 @@ static int vmdk_create(const char *filename,
QEMUOptionParameter *options,
}
if (backing_file) {
BlockDriverState *bs = bdrv_new("");
- ret = bdrv_open(bs, backing_file, NULL, 0, NULL, errp);
+ ret = bdrv_open(bs, backing_file, NULL, BDRV_O_NO_BACKING, NULL, errp);
if (ret != 0) {
bdrv_unref(bs);
return ret;
--
1.9.1
- [Qemu-devel] [PATCH 019/156] ide: Correct improper smart self test counter reset in ide core., (continued)
- [Qemu-devel] [PATCH 019/156] ide: Correct improper smart self test counter reset in ide core., Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 111/156] qcow2: Fix copy_sectors() with VM state, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 007/156] scsi: Change scsi sense buf size to 252, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 081/156] bochs: Fix bitmap offset calculation, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 043/156] Fix vmstate_info_int32_le comparison/assign, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 014/156] virtio-net: Do not filter VLANs without F_CTRL_VLAN, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 101/156] qcow2: Fix new L1 table size check (CVE-2014-0143), Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 103/156] dmg: prevent out-of-bounds array access on terminator, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 082/156] vpc/vhd: add bounds check for max_table_entries and block_size (CVE-2014-0144), Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 152/156] qapi: zero-initialize all QMP command parameters, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 023/156] block: Use BDRV_O_NO_BACKING where appropriate,
Michael Roth <=
- [Qemu-devel] [PATCH 140/156] scsi-disk: fix bug in scsi_block_new_request() introduced by commit 137745c, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 067/156] migration: remove duplicate code, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 092/156] qcow2: Validate active L1 table offset and size (CVE-2014-0144), Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 009/156] tap: avoid deadlocking rx, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 008/156] qom: Avoid leaking str and bool properties on failure, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 011/156] configure: Don't use __int128_t for clang versions before 3.2, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 114/156] parallels: Fix catalog size integer overflow (CVE-2014-0143), Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 015/156] hw/net/stellaris_enet: Restructure tx_fifo code to avoid buffer overrun, Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 119/156] qcow1: Validate image size (CVE-2014-0223), Michael Roth, 2014/07/08
- [Qemu-devel] [PATCH 118/156] qcow1: Validate L2 table size (CVE-2014-0222), Michael Roth, 2014/07/08