aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2018-06-29 14:37:03 +0300
committerKevin Wolf <kwolf@redhat.com>2018-08-15 12:50:39 +0200
commit261dbcb18f80dad3720209285e2ddd4e1a0b22c3 (patch)
tree199d557dcfd9644b7231d913573b1c81213ec549
parent4c8350fe1729b072473417dc22fa6410a4383127 (diff)
downloadqemu-261dbcb18f80dad3720209285e2ddd4e1a0b22c3.zip
qemu-261dbcb18f80dad3720209285e2ddd4e1a0b22c3.tar.gz
qemu-261dbcb18f80dad3720209285e2ddd4e1a0b22c3.tar.bz2
block: Simplify append_open_options()
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 <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/block.c b/block.c
index 8c95f98..6161dbe 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;
}
}