qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 3/4] blockdev: Add missing bdrv_unref() in drive-back


From: Kevin Wolf
Subject: [Qemu-devel] [PULL 3/4] blockdev: Add missing bdrv_unref() in drive-backup
Date: Wed, 18 Nov 2015 17:09:02 +0100

From: Max Reitz <address@hidden>

All error paths after a successful bdrv_open() of target_bs should
contain a bdrv_unref(target_bs). This one did not yet, so add it.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 blockdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/blockdev.c b/blockdev.c
index 917ae06..07c1741 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3171,6 +3171,7 @@ static void do_drive_backup(const char *device, const 
char *target,
         bmap = bdrv_find_dirty_bitmap(bs, bitmap);
         if (!bmap) {
             error_setg(errp, "Bitmap '%s' could not be found", bitmap);
+            bdrv_unref(target_bs);
             goto out;
         }
     }
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]