[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 20/21] block: Simplify append_open_options()
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 20/21] block: Simplify append_open_options() |
Date: |
Wed, 15 Aug 2018 14:55:36 +0200 |
From: Alberto Garcia <address@hidden>
This function returns a BDS's driver-specific options, excluding also
those from its children. Since we have just removed all children
options from bs->options there's no need to do this last step.
We allow references to children, though ("backing": "node0"), so those
we still have to remove.
Signed-off-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/block.c b/block.c
index 8c95f9893a..6161dbe3eb 100644
--- a/block.c
+++ b/block.c
@@ -5150,16 +5150,13 @@ static bool append_open_options(QDict *d,
BlockDriverState *bs)
QemuOptDesc *desc;
BdrvChild *child;
bool found_any = false;
- const char *p;
for (entry = qdict_first(bs->options); entry;
entry = qdict_next(bs->options, entry))
{
- /* Exclude options for children */
+ /* Exclude node-name references to children */
QLIST_FOREACH(child, &bs->children, next) {
- if (strstart(qdict_entry_key(entry), child->name, &p)
- && (!*p || *p == '.'))
- {
+ if (!strcmp(entry->key, child->name)) {
break;
}
}
--
2.13.6
- [Qemu-block] [PULL 12/21] mirror: Fail gracefully for source == target, (continued)
- [Qemu-block] [PULL 12/21] mirror: Fail gracefully for source == target, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 08/21] block: Remove deprecated -drive option addr, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 09/21] block: Remove deprecated -drive option serial, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 13/21] qemu-img: fix regression copying secrets during convert, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 15/21] block: drop empty .bdrv_close handlers, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 16/21] qdict: Make qdict_extract_subqdict() accept dst = NULL, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 14/21] block: make .bdrv_close optional, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 10/21] block: Remove dead deprecation warning code, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 18/21] block: Simplify bdrv_reopen_abort(), Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 21/21] qapi: block: Remove mentions of error types which were removed, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 20/21] block: Simplify append_open_options(),
Kevin Wolf <=
- [Qemu-block] [PULL 11/21] qapi/block: Document restrictions for node names, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 19/21] block: Update bs->options if bdrv_reopen() succeeds, Kevin Wolf, 2018/08/15
- [Qemu-block] [PULL 17/21] block: Remove children options from bs->{options, explicit_options}, Kevin Wolf, 2018/08/15
- Re: [Qemu-block] [PULL 00/21] Block layer patches, Peter Maydell, 2018/08/16