[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/5] block: Simplify append_open_options()
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH 5/5] block: Simplify append_open_options() |
Date: |
Fri, 29 Jun 2018 14:37:03 +0300 |
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>
---
block.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/block.c b/block.c
index 58c8e8e677..9b91b01849 100644
--- a/block.c
+++ b/block.c
@@ -5210,16 +5210,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.11.0
- [Qemu-devel] [PATCH 0/5] Some bs->options fixes, Alberto Garcia, 2018/06/29
- [Qemu-devel] [PATCH 3/5] block: Simplify bdrv_reopen_abort(), Alberto Garcia, 2018/06/29
- [Qemu-devel] [PATCH 4/5] block: Update bs->options if bdrv_reopen() succeeds, Alberto Garcia, 2018/06/29
- [Qemu-devel] [PATCH 5/5] block: Simplify append_open_options(),
Alberto Garcia <=
- [Qemu-devel] [PATCH 2/5] block: Remove children options from bs->{options, explicit_options}, Alberto Garcia, 2018/06/29
- [Qemu-devel] [PATCH 1/5] qdict: Make qdict_extract_subqdict() accept dst = NULL, Alberto Garcia, 2018/06/29