[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 21/36] rbd: Close image in qemu_rbd_open() error path
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 21/36] rbd: Close image in qemu_rbd_open() error path |
Date: |
Mon, 5 Nov 2018 17:37:29 +0100 |
Commit e2b8247a322 introduced an error path in qemu_rbd_open() after
calling rbd_open(), but neglected to close the image again in this error
path. The error path should contain everything that the regular close
function qemu_rbd_close() contains.
This adds the missing rbd_close() call.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block/rbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/rbd.c b/block/rbd.c
index e5bf5a146f..1e9819a50f 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -787,6 +787,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict
*options, int flags,
"automatically marking the image read-only.");
r = bdrv_set_read_only(bs, true, &local_err);
if (r < 0) {
+ rbd_close(s->image);
error_propagate(errp, local_err);
goto failed_open;
}
--
2.19.1
- [Qemu-block] [PULL 14/36] quorum: Remove quorum_err(), (continued)
- [Qemu-block] [PULL 14/36] quorum: Remove quorum_err(), Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 11/36] vpc: Don't leak opts in vpc_open(), Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 28/36] block: Make auto-read-only=on default for -drive, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 32/36] qdev-monitor: Make device options help nicer, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 35/36] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 20/36] block: Add auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 34/36] fw_cfg: Drop newline in @file description, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 29/36] qemu-iotests: Test auto-read-only with -drive and -blockdev, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 24/36] file-posix: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 21/36] rbd: Close image in qemu_rbd_open() error path,
Kevin Wolf <=
- [Qemu-block] [PULL 26/36] gluster: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 36/36] include: Add a comment to explain the origin of sizes' lookup table, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 33/36] object: Make option help nicer to read, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 25/36] curl: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 27/36] iscsi: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 13/36] block/vdi: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- Re: [Qemu-block] [PULL 00/36] Block layer patches, Peter Maydell, 2018/11/05