[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v3 13/35] block: Open backing image in force share mo
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL v3 13/35] block: Open backing image in force share mode for size probe |
Date: |
Fri, 22 Dec 2017 16:18:24 +0100 |
From: Fam Zheng <address@hidden>
Management tools create overlays of running guests with qemu-img:
$ qemu-img create -b /image/in/use.qcow2 -f qcow2 /overlay/image.qcow2
but this doesn't work anymore due to image locking:
qemu-img: /overlay/image.qcow2: Failed to get shared "write" lock
Is another process using the image?
Could not open backing image to determine size.
Use the force share option to allow this use case again.
Cc: address@hidden
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index db0be7ef36..dd90dca896 100644
--- a/block.c
+++ b/block.c
@@ -4605,10 +4605,11 @@ void bdrv_img_create(const char *filename, const char
*fmt,
back_flags = flags;
back_flags &= ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING);
+ backing_options = qdict_new();
if (backing_fmt) {
- backing_options = qdict_new();
qdict_put_str(backing_options, "driver", backing_fmt);
}
+ qdict_put_bool(backing_options, BDRV_OPT_FORCE_SHARE, true);
bs = bdrv_open(full_backing, NULL, backing_options, back_flags,
&local_err);
--
2.13.6
- [Qemu-devel] [PULL v3 02/35] iotests: fix 197 for vpc, (continued)
- [Qemu-devel] [PULL v3 02/35] iotests: fix 197 for vpc, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 01/35] block: Formats don't need CONSISTENT_READ with NO_IO, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 03/35] block: Make bdrv_drain_invoke() recursive, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 04/35] block: Call .drain_begin only once in bdrv_drain_all_begin(), Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 08/35] block: Unify order in drain functions, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 05/35] test-bdrv-drain: Test BlockDriver callbacks for drain, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 07/35] block: Don't wait for requests in bdrv_drain*_end(), Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 06/35] block: bdrv_drain_recurse(): Remove unused begin parameter, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 10/35] qcow2: get rid of qcow2_backing_read1 routine, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 09/35] block: Don't acquire AioContext in hmp_qemu_io(), Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 13/35] block: Open backing image in force share mode for size probe,
Kevin Wolf <=
- [Qemu-devel] [PULL v3 11/35] block: Document that x-blockdev-change breaks quorum children list, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 14/35] block: Remove the obsolete -drive boot=on|off parameter, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 15/35] block: Remove the deprecated -hdachs option, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 12/35] nvme: Add tracing, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 19/35] block: Make bdrv_drain() driver callbacks non-recursive, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 16/35] block: Mention -drive cyls/heads/secs/trans/serial/addr in deprecation chapter, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 17/35] block: Remove unused bdrv_requests_pending, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 24/35] block: Don't block_job_pause_all() in bdrv_drain_all(), Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 25/35] block: Nested drain_end must still call callbacks, Kevin Wolf, 2017/12/22
- [Qemu-devel] [PULL v3 22/35] blockjob: Pause job on draining any job BDS, Kevin Wolf, 2017/12/22