From nobody Tue Nov 4 15:13:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530272414857579.3409131406988; Fri, 29 Jun 2018 04:40:14 -0700 (PDT) Received: from localhost ([::1]:41335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYrl8-0003QQ-4b for importer@patchew.org; Fri, 29 Jun 2018 07:40:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYrjC-0001rm-2V for qemu-devel@nongnu.org; Fri, 29 Jun 2018 07:38:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYriz-0005HF-Fj for qemu-devel@nongnu.org; Fri, 29 Jun 2018 07:38:14 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:41366) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYriz-0004S4-3H; Fri, 29 Jun 2018 07:38:01 -0400 Received: from 88-114-101-78.elisa-laajakaista.fi ([88.114.101.78] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1fYriN-0006Od-QP; Fri, 29 Jun 2018 13:37:23 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1fYriA-0008Ki-SH; Fri, 29 Jun 2018 14:37:10 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=88NXl434YMlTmh+OyWsW/u9JPGvXSHWrTzlQsh/RkKw=; b=XSxTWVu5eVOWhmxqPMLpJPAAg5l6wEiPzQyDMoSrocTwuNIY3XFZeHk/QZWV83RuHQ1lyKEodfPHENkHGPhL9PNyRFhPWfGjUQR2uOUf6ILX3Z5X9e+5ch7yMSlwA2p5DPhYcQNQRVNO20fJmcBNOYGjELCYqCTZSvso+yV6ITB+qMm0ZEEwwrSllasUUL++uvXOueSUN8We2fLe8aQgzDd/iDmlEfbxikbwpwVrR7gO0ZPBCtL5opRMxE+v/qz36mS1oU2lY9uKruJxlRZ4/U/j8jnpnHqolw0PSK3DBin8kIHcvbVQ/gH4DH+MneZLy4rugBxNAOFNFVApwXSq8g==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 29 Jun 2018 14:37:03 +0300 Message-Id: <0ac388e86dec1afbff4b5e4e6ade1f1fb7b2d7ff.1530270904.git.berto@igalia.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH 5/5] block: Simplify append_open_options() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 --- 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, BlockDriv= erState *bs) QemuOptDesc *desc; BdrvChild *child; bool found_any =3D false; - const char *p; =20 for (entry =3D qdict_first(bs->options); entry; entry =3D 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 =3D=3D '.')) - { + if (!strcmp(entry->key, child->name)) { break; } } --=20 2.11.0