[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/21] block: Simplify bdrv_reopen_abort()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 18/21] block: Simplify bdrv_reopen_abort() |
Date: |
Wed, 15 Aug 2018 14:55:34 +0200 |
From: Alberto Garcia <address@hidden>
If a bdrv_reopen_multiple() call fails, then the explicit_options
QDict has to be deleted for every entry in the reopen queue. This must
happen regardless of whether that entry's bdrv_reopen_prepare() call
succeeded or not.
This patch simplifies the cleanup code a bit.
Signed-off-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/block.c b/block.c
index a8fbab396d..e82cfa6fe2 100644
--- a/block.c
+++ b/block.c
@@ -3050,9 +3050,10 @@ int bdrv_reopen_multiple(AioContext *ctx,
BlockReopenQueue *bs_queue, Error **er
cleanup:
QSIMPLEQ_FOREACH_SAFE(bs_entry, bs_queue, entry, next) {
- if (ret && bs_entry->prepared) {
- bdrv_reopen_abort(&bs_entry->state);
- } else if (ret) {
+ if (ret) {
+ if (bs_entry->prepared) {
+ bdrv_reopen_abort(&bs_entry->state);
+ }
qobject_unref(bs_entry->state.explicit_options);
}
qobject_unref(bs_entry->state.options);
@@ -3341,8 +3342,6 @@ void bdrv_reopen_abort(BDRVReopenState *reopen_state)
drv->bdrv_reopen_abort(reopen_state);
}
- qobject_unref(reopen_state->explicit_options);
-
bdrv_abort_perm_update(reopen_state->bs);
}
--
2.13.6
- [Qemu-devel] [PULL 13/21] qemu-img: fix regression copying secrets during convert, (continued)
- [Qemu-devel] [PULL 13/21] qemu-img: fix regression copying secrets during convert, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 11/21] qapi/block: Document restrictions for node names, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 09/21] block: Remove deprecated -drive option serial, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 17/21] block: Remove children options from bs->{options, explicit_options}, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 12/21] mirror: Fail gracefully for source == target, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 21/21] qapi: block: Remove mentions of error types which were removed, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 10/21] block: Remove dead deprecation warning code, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 20/21] block: Simplify append_open_options(), Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 19/21] block: Update bs->options if bdrv_reopen() succeeds, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 14/21] block: make .bdrv_close optional, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 18/21] block: Simplify bdrv_reopen_abort(),
Kevin Wolf <=
- [Qemu-devel] [PULL 16/21] qdict: Make qdict_extract_subqdict() accept dst = NULL, Kevin Wolf, 2018/08/15
- [Qemu-devel] [PULL 08/21] block: Remove deprecated -drive option addr, Kevin Wolf, 2018/08/15
- Re: [Qemu-devel] [PULL 00/21] Block layer patches, Peter Maydell, 2018/08/16