[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 26/27] block: Don't use error_abort in blk_new_open
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 26/27] block: Don't use error_abort in blk_new_open |
Date: |
Tue, 7 Mar 2017 16:40:50 +0100 |
From: Fam Zheng <address@hidden>
We have an errp and bdrv_root_attach_child can fail permission check,
error_abort is not the best choice here.
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/block-backend.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index daa7908..5742c09 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -213,7 +213,12 @@ BlockBackend *blk_new_open(const char *filename, const
char *reference,
}
blk->root = bdrv_root_attach_child(bs, "root", &child_root,
- perm, BLK_PERM_ALL, blk, &error_abort);
+ perm, BLK_PERM_ALL, blk, errp);
+ if (!blk->root) {
+ bdrv_unref(bs);
+ blk_unref(blk);
+ return NULL;
+ }
return blk;
}
--
1.8.3.1
- [Qemu-block] [PULL 19/27] sheepdog: Implement bdrv_parse_filename(), (continued)
- [Qemu-block] [PULL 19/27] sheepdog: Implement bdrv_parse_filename(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 17/27] sheepdog: Report errors in pseudo-filename more usefully, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 18/27] sheepdog: Use SocketAddress and socket_connect(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 20/27] gluster: Drop assumptions on SocketTransport names, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 21/27] gluster: Don't duplicate qapi-util.c's qapi_enum_parse(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 22/27] gluster: Plug memory leaks in qemu_gluster_parse_json(), Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 25/27] sheepdog: Support blockdev-add, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 24/27] qapi-schema: Rename SocketAddressFlat's variant tcp to inet, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 23/27] qapi-schema: Rename GlusterServer to SocketAddressFlat, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 27/27] commit: Don't use error_abort in commit_start, Kevin Wolf, 2017/03/07
- [Qemu-block] [PULL 26/27] block: Don't use error_abort in blk_new_open,
Kevin Wolf <=
- Re: [Qemu-block] [Qemu-devel] [PULL 00/27] Block layer fixes for 2.9.0-rc0, Peter Maydell, 2017/03/08