[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to Blockde
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat |
Date: |
Thu, 10 Sep 2015 16:39:10 +0300 |
If set to true, the image will be opened with the BDRV_O_NO_BACKING
flag. This is useful for creating snapshots using images opened with
blockdev-add, since they are not supposed to have a backing image
before the operation.
Signed-off-by: Alberto Garcia <address@hidden>
---
block.c | 5 +++++
qapi/block-core.json | 6 +++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 22d3b0e..4be32fb 100644
--- a/block.c
+++ b/block.c
@@ -1469,6 +1469,11 @@ static int bdrv_open_inherit(BlockDriverState **pbs,
const char *filename,
assert(drvname || !(flags & BDRV_O_PROTOCOL));
+ if (qdict_get_try_bool(options, "ignore-backing", false)) {
+ flags |= BDRV_O_NO_BACKING;
+ }
+ qdict_del(options, "ignore-backing");
+
bs->open_flags = flags;
bs->options = options;
options = qdict_clone_shallow(options);
diff --git a/qapi/block-core.json b/qapi/block-core.json
index ec50f06..0f797d7 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1498,11 +1498,15 @@
# allowed to pass an empty string here in order to disable the
# default backing file.
#
+# @ignore-backing: #optional if true, no backing file will be
+# opened. Defaults to false (Since 2.5)
+#
# Since: 1.7
##
{ 'struct': 'BlockdevOptionsGenericCOWFormat',
'base': 'BlockdevOptionsGenericFormat',
- 'data': { '*backing': 'BlockdevRef' } }
+ 'data': { '*backing': 'BlockdevRef',
+ '*ignore-backing': 'bool' } }
##
# @Qcow2OverlapCheckMode
--
2.5.1
- [Qemu-devel] [PATCH v3 0/4] Add 'blockdev-snapshot' command, Alberto Garcia, 2015/09/10
- [Qemu-devel] [PATCH v3 1/4] block: rename BlockdevSnapshot to BlockdevSnapshotSync, Alberto Garcia, 2015/09/10
- [Qemu-devel] [PATCH v3 3/4] block: add a 'blockdev-snapshot' QMP command, Alberto Garcia, 2015/09/10
- [Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat,
Alberto Garcia <=
- Re: [Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat, Max Reitz, 2015/09/11
- Re: [Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat, Kevin Wolf, 2015/09/11
- Re: [Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat, Max Reitz, 2015/09/11
- Re: [Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat, Alberto Garcia, 2015/09/14
- Re: [Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat, Kevin Wolf, 2015/09/14
- Re: [Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat, Alberto Garcia, 2015/09/14
Re: [Qemu-devel] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat, Eric Blake, 2015/09/11
[Qemu-devel] [PATCH v3 4/4] block: add tests for the 'blockdev-snapshot' command, Alberto Garcia, 2015/09/10