From nobody Mon Feb 9 03:12:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1559144984; cv=none; d=zoho.com; s=zohoarc; b=V0k3jP7fbC/mePgWxFWzX0uoIZPFnBwdHiIdE6J3r9XpV6+woNqBNWBLE7uLAYnHM6vI9VbAhGxKSF7ZsoGhy0k0sezY8Q4bsnq4D5jkSTsf4uhWeGBjwiZq4uwnIWobcQF2KznFcaJseb1qrmjPN8UKjLsqoO8JhTnDVhlOVY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559144984; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=HOajXc7kGd5NDgrSSsMnOo3ldsI/Ii1xm0S92qjmAm0=; b=MhyYumqCgf2fsJnK8F4JE/hU2dj+WHIeMrnUo3wKYYyuEECn6ub0jAREsojPGUZB7rv58q5mlO3ZhlP4IO1ZiaGjD/E0B0fP6clXVi2bZKJ6h2Rutvqi2LlE9NdpWCnJ7f8eRrIml8gVLGtkH2X/15QaUncgySKaN90vlVp5RD4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559144983899766.8044255962135; Wed, 29 May 2019 08:49:43 -0700 (PDT) Received: from localhost ([127.0.0.1]:56880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW0pa-0005n9-SL for importer@patchew.org; Wed, 29 May 2019 11:49:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW0n8-0004V5-Vo for qemu-devel@nongnu.org; Wed, 29 May 2019 11:47:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hW0n7-00053R-Rh for qemu-devel@nongnu.org; Wed, 29 May 2019 11:47:02 -0400 Received: from relay.sw.ru ([185.231.240.75]:43146) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hW0n7-00051w-IO; Wed, 29 May 2019 11:47:01 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1hW0n2-0004iP-7J; Wed, 29 May 2019 18:46:56 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 29 May 2019 18:46:50 +0300 Message-Id: <20190529154654.95870-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190529154654.95870-1-vsementsov@virtuozzo.com> References: <20190529154654.95870-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v8 3/7] block: allow not one child for implicit node 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: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, mreitz@redhat.com, stefanha@redhat.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Upcoming backup-top filter wants to operate like usual implicit filter node with fall-through to backing child. But also needs additional target child, let's support that. On the other hand, after backup completion (before job dismiss) filter is still attached to job blk, but don't have any children. Support this too. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 57216f4115..3f4de3ae32 100644 --- a/block.c +++ b/block.c @@ -6200,9 +6200,20 @@ void bdrv_refresh_filename(BlockDriverState *bs) } =20 if (bs->implicit) { - /* For implicit nodes, just copy everything from the single child = */ + /* + * For implicit nodes, just copy everything from the single child = or + * from backing, if there are several children. + * If there are no children for some reason (filter is still attac= hed + * to block-job blk, but already removed from backing chain of dev= ice) + * do nothing. + */ child =3D QLIST_FIRST(&bs->children); - assert(QLIST_NEXT(child, next) =3D=3D NULL); + if (!child) { + return; + } else if (QLIST_NEXT(child, next)) { + assert(bs->backing); + child =3D bs->backing; + } =20 pstrcpy(bs->exact_filename, sizeof(bs->exact_filename), child->bs->exact_filename); --=20 2.18.0