aboutsummaryrefslogtreecommitdiff
path: root/block/export
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2020-09-24 17:27:08 +0200
committerKevin Wolf <kwolf@redhat.com>2020-10-02 15:46:40 +0200
commit37a4f70cea72a38fe981cbff517c222cefa46f21 (patch)
tree1551ddfb797090c1238e60b86aaed8921f73f02f /block/export
parent1a9f7a804f52caee6bc6769a8bb0a018e6c8ec81 (diff)
block/export: Move blk to BlockExport
Every block export has a BlockBackend representing the disk that is exported. It should live in BlockExport therefore. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200924152717.287415-23-kwolf@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/export')
-rw-r--r--block/export/export.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/export/export.c b/block/export/export.c
index 87940d5c40..ad374a6649 100644
--- a/block/export/export.c
+++ b/block/export/export.c
@@ -92,6 +92,8 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp)
return NULL;
}
+ assert(exp->blk != NULL);
+
QLIST_INSERT_HEAD(&block_exports, exp, next);
return exp;
}
@@ -114,6 +116,7 @@ static void blk_exp_delete_bh(void *opaque)
assert(exp->refcount == 0);
QLIST_REMOVE(exp, next);
exp->drv->delete(exp);
+ blk_unref(exp->blk);
qapi_event_send_block_export_deleted(exp->id);
g_free(exp->id);
g_free(exp);