Blame SOURCES/kvm-rbd-Close-image-in-qemu_rbd_open-error-path.patch

7711c0
From 65f966b512842ad7654eb80a4b98cbfff7437751 Mon Sep 17 00:00:00 2001
7711c0
From: Kevin Wolf <kwolf@redhat.com>
7711c0
Date: Fri, 23 Nov 2018 10:41:45 +0100
7711c0
Subject: [PATCH 04/34] rbd: Close image in qemu_rbd_open() error path
7711c0
7711c0
RH-Author: Kevin Wolf <kwolf@redhat.com>
7711c0
Message-id: <20181123104154.13541-4-kwolf@redhat.com>
7711c0
Patchwork-id: 83113
7711c0
O-Subject: [RHEL-7.7/7.6.z qemu-kvm-rhev PATCH v2 03/12] rbd: Close image in qemu_rbd_open() error path
7711c0
Bugzilla: 1623986
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
RH-Acked-by: John Snow <jsnow@redhat.com>
7711c0
7711c0
Commit e2b8247a322 introduced an error path in qemu_rbd_open() after
7711c0
calling rbd_open(), but neglected to close the image again in this error
7711c0
path. The error path should contain everything that the regular close
7711c0
function qemu_rbd_close() contains.
7711c0
7711c0
This adds the missing rbd_close() call.
7711c0
7711c0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7711c0
Reviewed-by: Eric Blake <eblake@redhat.com>
7711c0
(cherry picked from commit a51b9c4862c29f427931f45ee1d39ac1663ba859)
7711c0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 block/rbd.c | 1 +
7711c0
 1 file changed, 1 insertion(+)
7711c0
7711c0
diff --git a/block/rbd.c b/block/rbd.c
7711c0
index 8f81fbc..8ce68c8 100644
7711c0
--- a/block/rbd.c
7711c0
+++ b/block/rbd.c
7711c0
@@ -779,6 +779,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
7711c0
                          "automatically marking the image read-only.");
7711c0
             r = bdrv_set_read_only(bs, true, &local_err);
7711c0
             if (r < 0) {
7711c0
+                rbd_close(s->image);
7711c0
                 error_propagate(errp, local_err);
7711c0
                 goto failed_open;
7711c0
             }
7711c0
-- 
7711c0
1.8.3.1
7711c0