From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518455; cv=none; d=zohomail.com; s=zohoarc; b=MJuoCXODA0NJ3znT0XzR3s4Bt62WuNy+vnmUt8UUPRJfjhwK4PkVFoCTT6nIabovYzNi7su1zN9FyddpgXQadm71gioNjhCsE/2aYo/iIN+3bqHwMk/UnoT946zohPOEOvn65WhQYI9qMaBv53OiD7vtdMUiwnVrO7781jrdY14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518455; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=G2TY0lDuH7MPCwUP698+pV4ISzVSlvQYUGHm5rkdMQw=; b=ZQfBNp8MPkRtWBiBpNShNdsTvGq5xpDLvUYmD4qFLw9PuvbPc0eLjdcp7JM+CrRKJwKQ6J4DaIVHHNUXB89JoxlauW3zjtForchDI+4fdt6O4gPcbNMdP3gl87z/us/uqJ3SkavQkl9DQrRD75QThkVl7uGmA3W6/JN8vRRp+QU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518455607326.4401097516741; Wed, 6 Oct 2021 04:07:35 -0700 (PDT) Received: from localhost ([::1]:50266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4lq-0000g7-Jt for importer@patchew.org; Wed, 06 Oct 2021 07:07:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eB-00082F-GA for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4e8-0005uV-01 for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:39 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-433-DdvfdaXAMk2HuY3hJFVqHw-1; Wed, 06 Oct 2021 06:59:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 18A1A1006AA2; Wed, 6 Oct 2021 10:59:32 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2325F60BE5; Wed, 6 Oct 2021 10:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633517974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G2TY0lDuH7MPCwUP698+pV4ISzVSlvQYUGHm5rkdMQw=; b=ZVqfkW1OjqfHF3giurBEQTgjtaSjBDnYC8inM+5jQLMCC6y2uSM89LARIyALSNxGAvH1TP VrHZVnoPv/5yNJeyqgjitw6UxiOSLAoRRXPyNNNHMBz08LXIpuhqRj+a2JN3ld1HDtCiqP 4rFW79+LNAtDqUBX5s7OEi+5nwuOARQ= X-MC-Unique: DdvfdaXAMk2HuY3hJFVqHw-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 01/13] include/block.h: remove outdated comment Date: Wed, 6 Oct 2021 12:59:11 +0200 Message-Id: <20211006105923.223549-2-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518457301100001 Content-Type: text/plain; charset="utf-8" From: Emanuele Giuseppe Esposito There are a couple of errors in bdrv_drained_begin header comment: - block_job_pause does not exist anymore, it has been replaced with job_pause in b15de82867 - job_pause is automatically invoked as a .drained_begin callback (child_job_drained_begin) by the child_job BdrvChildClass struct in blockjob.c. So no additional pause should be required. Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20210903113800.59970-1-eesposit@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- include/block/block.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index 740038a892..ab987e8a99 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -751,9 +751,7 @@ bool bdrv_drain_poll(BlockDriverState *bs, bool recursi= ve, * bdrv_drained_begin: * * Begin a quiesced section for exclusive access to the BDS, by disabling - * external request sources including NBD server and device model. Note th= at - * this doesn't block timers or coroutines from submitting more requests, = which - * means block_job_pause is still necessary. + * external request sources including NBD server, block jobs, and device m= odel. * * This function can be recursive. */ --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518245; cv=none; d=zohomail.com; s=zohoarc; b=dGV0XiPvHnK50frKf6oetjjSr8T6h6GjZ93Zo2uJ2NnYihgCehXT70e4KayDc3YDHUhEsZzKtm0O5ve9Jqi0JIq3IQn2aUz198qr7+C7zNwFI3L/CoIYz7SMrDkWvxnePN/lvWlJfy4VOkf/9365O6wAVVOq5JLqNzxNwYLX2CM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LGfde9CiAc4R+tCtcOIems66/aZ0letPuexkCiB9oiA=; b=aGYw6HdBzikHM5ed3Ji/UEFXdkOCa+Oy6EAm7kMPEWWNeZ5j/B5IsDyjDBg0/8sbYdYt78YKvwTeq2CgAvFG9h1IURVAjXuMK0Mm47EcPGDl90kVJ6nf/fXWcoYVqEEr/0b+2tw7pVAJwnt5f78lGcR6DNBXlAieLv5CNmP1FcI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518245123684.1913739861379; Wed, 6 Oct 2021 04:04:05 -0700 (PDT) Received: from localhost ([::1]:42010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4iR-0003Cw-OP for importer@patchew.org; Wed, 06 Oct 2021 07:04:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eB-00081v-0v for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54145) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4e8-0005vn-De for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:38 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-238-6GS1FALpMQCzqUz1sqQszg-1; Wed, 06 Oct 2021 06:59:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59F68835DF7; Wed, 6 Oct 2021 10:59:33 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F93A60BE5; Wed, 6 Oct 2021 10:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633517975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LGfde9CiAc4R+tCtcOIems66/aZ0letPuexkCiB9oiA=; b=YHY+jbpzEfoxIdhcgJ4GPf0saGkNKQAFd9chE71soXR5Ga5MadpEMkgjaKez9q9A9v4r2b DPDJrJNztT8kEPTL44XybQlIpq4GqSg5j/WIRnOs1rbxbe0GXLExx3ML0n/isGyhLA31PO 9tP/0X7wqGkn9s71Ixq5r01XC8937ws= X-MC-Unique: 6GS1FALpMQCzqUz1sqQszg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 02/13] qemu-storage-daemon: Only display FUSE help when FUSE is built-in Date: Wed, 6 Oct 2021 12:59:12 +0200 Message-Id: <20211006105923.223549-3-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518246974100001 From: Philippe Mathieu-Daud=C3=A9 When configuring QEMU with --disable-fuse, the qemu-storage-daemon still reports FUSE command line options in its help: $ qemu-storage-daemon -h Usage: qemu-storage-daemon [options] QEMU storage daemon --export [type=3D]fuse,id=3D,node-name=3D,mountpoint=3D<= file> [,growable=3Don|off][,writable=3Don|off] export the specified block node over FUSE Remove this help message when FUSE is disabled, to avoid: $ qemu-storage-daemon --export fuse qemu-storage-daemon: --export fuse: Invalid parameter 'fuse' Reported-by: Qing Wang Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210816180442.2000642-1-philmd@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz Signed-off-by: Kevin Wolf --- storage-daemon/qemu-storage-daemon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-sto= rage-daemon.c index fc8b150629..10a1a33761 100644 --- a/storage-daemon/qemu-storage-daemon.c +++ b/storage-daemon/qemu-storage-daemon.c @@ -98,10 +98,12 @@ static void help(void) " export the specified block node over NBD\n" " (requires --nbd-server)\n" "\n" +#ifdef CONFIG_FUSE " --export [type=3D]fuse,id=3D,node-name=3D,mountpoint=3D<= file>\n" " [,growable=3Don|off][,writable=3Don|off]\n" " export the specified block node over FUSE\n" "\n" +#endif /* CONFIG_FUSE */ " --monitor [chardev=3D]name[,mode=3Dcontrol][,pretty[=3Don|off]]\n" " configure a QMP monitor\n" "\n" --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518470; cv=none; d=zohomail.com; s=zohoarc; b=RLPoLGeEJIPohWWtk4KgHu5HIfL/c48n07GIi9hHWI1duzqq+qqVGtPE5CkFUbLW/TQDl8TuNFPwxwnefNI+dfMQcMsZQzFPgUMe6H6OUys/jzQ30KYmb8Tad5FjVl28PwBZi4594pJ51wrRBj5935+C6nnXeD4ZyM/5LQF5uk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518470; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Vx3OcyrLTGboCEi9qWxoNVp9d9HAIuZjXKNNyT5t1nE=; b=jRqjEhG/NX7k6q6/a6vs7i+Py47H66SJiMgpb513qfo48LjrGFpjknWJcu8V97sPPAueAUYvNfnj79qfsHjTPcDIvQaXkoJRl1HQC5NLhF2+tNHBcuKywbd6WYDZ7toJCwlsRitsD+vYiw8gF4sJUVpPQglywj5xNDNevLnM12M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518470763867.1182895853831; Wed, 6 Oct 2021 04:07:50 -0700 (PDT) Received: from localhost ([::1]:50800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4m5-00015X-0z for importer@patchew.org; Wed, 06 Oct 2021 07:07:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eJ-0008C0-3G for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42449) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eF-00062F-9j for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-531-2gWQ_3DIPEW6q26p2kJLzw-1; Wed, 06 Oct 2021 06:59:39 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 69EBA180830E; Wed, 6 Oct 2021 10:59:38 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id A533860BE5; Wed, 6 Oct 2021 10:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633517982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vx3OcyrLTGboCEi9qWxoNVp9d9HAIuZjXKNNyT5t1nE=; b=ifqxW81+n2h7wqBUOzj/P0F4HXcinVtIkBRGXWPZBETck2KYxy5YUpBm1+redpB1v3kLqa aA4Db/lZVA0rwA4HCiLroGdfoCocn1rSvy3npgWFEgHrw+N3RtRq2r4u/MtaTh6TlhtS4J r1aTdNbwO1u0dWeKpt0nUhvH8VINsck= X-MC-Unique: 2gWQ_3DIPEW6q26p2kJLzw-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 03/13] block: implement bdrv_new_open_driver_opts() Date: Wed, 6 Oct 2021 12:59:13 +0200 Message-Id: <20211006105923.223549-4-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -9 X-Spam_score: -1.0 X-Spam_bar: - X-Spam_report: (-1.0 / 5.0 requ) DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518471425100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Add version of bdrv_new_open_driver() that supports QDict options. We'll use it in further commit. Simply add one more argument to bdrv_new_open_driver() is worse, as there are too many invocations of bdrv_new_open_driver() to update then. Signed-off-by: Vladimir Sementsov-Ogievskiy Suggested-by: Kevin Wolf Message-Id: <20210920115538.264372-2-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- include/block/block.h | 4 ++++ block.c | 25 +++++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index ab987e8a99..e5dd22b034 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -383,6 +383,10 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict= *parent_options, const char *bdref_key, Error **errp); BlockDriverState *bdrv_open(const char *filename, const char *reference, QDict *options, int flags, Error **errp); +BlockDriverState *bdrv_new_open_driver_opts(BlockDriver *drv, + const char *node_name, + QDict *options, int flags, + Error **errp); BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char *node_= name, int flags, Error **errp); BlockReopenQueue *bdrv_reopen_queue(BlockReopenQueue *bs_queue, diff --git a/block.c b/block.c index 5ce08a79fd..917fb7faca 100644 --- a/block.c +++ b/block.c @@ -1604,16 +1604,26 @@ open_failed: return ret; } =20 -BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char *node_= name, - int flags, Error **errp) +/* + * Create and open a block node. + * + * @options is a QDict of options to pass to the block drivers, or NULL fo= r an + * empty set of options. The reference to the QDict belongs to the block l= ayer + * after the call (even on failure), so if the caller intends to reuse the + * dictionary, it needs to use qobject_ref() before calling bdrv_open. + */ +BlockDriverState *bdrv_new_open_driver_opts(BlockDriver *drv, + const char *node_name, + QDict *options, int flags, + Error **errp) { BlockDriverState *bs; int ret; =20 bs =3D bdrv_new(); bs->open_flags =3D flags; - bs->explicit_options =3D qdict_new(); - bs->options =3D qdict_new(); + bs->options =3D options ?: qdict_new(); + bs->explicit_options =3D qdict_clone_shallow(bs->options); bs->opaque =3D NULL; =20 update_options_from_flags(bs->options, flags); @@ -1631,6 +1641,13 @@ BlockDriverState *bdrv_new_open_driver(BlockDriver *= drv, const char *node_name, return bs; } =20 +/* Create and open a block node. */ +BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char *node_= name, + int flags, Error **errp) +{ + return bdrv_new_open_driver_opts(drv, node_name, NULL, flags, errp); +} + QemuOptsList bdrv_runtime_opts =3D { .name =3D "bdrv_common", .head =3D QTAILQ_HEAD_INITIALIZER(bdrv_runtime_opts.head), --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518695; cv=none; d=zohomail.com; s=zohoarc; b=gE/ql74LLfdLwJlNfXDVm2X/B/thHchH4+QMvXt9AG7V4jupvGIf5n1CKgFxHNJ/T81js0Q4aVvmY4ec7ks8t+BHFMeERHmSlNmBMQzcXZrRTRBxX9U1m6+WxGPYDy6OnlOHZOPB9yfYCpayfIVnHMHFMZnvwVGBhcz2HMpslrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518695; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JRceF0LMand2ACut0y8W1Ywg/k35iNtfLJXW/w9ptao=; b=D/PtV9EsRHPlyWw32BDBIJ01FDJ0Z4XhO2V3yrEXus3PAbFS+nhsAk1ZhpMBPsjY88ZSERuxwLntQfeBmRS1joct/obaUXY/v2Ofi6CE3XiFdKXfz6P2KDie2V0zOZmHuQFwyfWhFe2xKVkXPBHjoc67XbuSd3s26oiOHnU+1yI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518695542542.7732592982276; Wed, 6 Oct 2021 04:11:35 -0700 (PDT) Received: from localhost ([::1]:56402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4pi-0005bf-9S for importer@patchew.org; Wed, 06 Oct 2021 07:11:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eK-0008EZ-Bd for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eH-00063x-Bw for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:48 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-446-Uh695-74NyOgpdy2wUw1iA-1; Wed, 06 Oct 2021 06:59:43 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81B12802C80; Wed, 6 Oct 2021 10:59:42 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD53360BE5; Wed, 6 Oct 2021 10:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633517984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JRceF0LMand2ACut0y8W1Ywg/k35iNtfLJXW/w9ptao=; b=ZTuDW9x/PsUfmN9s7tlqDXRXtlCbDzkpFopa57zrWmulETIfPndDvYks89v6hCZgbEJIlm y+MFhEl0lN1wvDeVySuZpTbchRhk6jT0mu7dbtRUx/aXv6P62xx9otTU2iY/X+t5X6H7BE tMIFY2E+oI7chy6R8QTtANYGeP26YCQ= X-MC-Unique: Uh695-74NyOgpdy2wUw1iA-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 04/13] block: bdrv_insert_node(): fix and improve error handling Date: Wed, 6 Oct 2021 12:59:14 +0200 Message-Id: <20211006105923.223549-5-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518697154100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy - use ERRP_GUARD(): function calls error_prepend(), so it must use ERRP_GUARD(), otherwise error_prepend() would not be called when passed errp is error_fatal - drop error propagation, handle return code instead - for symmetry, do error_prepend() for the second failure Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210920115538.264372-3-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- block.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 917fb7faca..5d49188073 100644 --- a/block.c +++ b/block.c @@ -5122,8 +5122,9 @@ static void bdrv_delete(BlockDriverState *bs) BlockDriverState *bdrv_insert_node(BlockDriverState *bs, QDict *node_optio= ns, int flags, Error **errp) { + ERRP_GUARD(); + int ret; BlockDriverState *new_node_bs; - Error *local_err =3D NULL; =20 new_node_bs =3D bdrv_open(NULL, NULL, node_options, flags, errp); if (new_node_bs =3D=3D NULL) { @@ -5132,12 +5133,12 @@ BlockDriverState *bdrv_insert_node(BlockDriverState= *bs, QDict *node_options, } =20 bdrv_drained_begin(bs); - bdrv_replace_node(bs, new_node_bs, &local_err); + ret =3D bdrv_replace_node(bs, new_node_bs, errp); bdrv_drained_end(bs); =20 - if (local_err) { + if (ret < 0) { + error_prepend(errp, "Could not replace node: "); bdrv_unref(new_node_bs); - error_propagate(errp, local_err); return NULL; } =20 --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518335; cv=none; d=zohomail.com; s=zohoarc; b=AfJfqiUXcp+7KBY7RzhxPB5TsVzryg0O+Nj83wCqTgp+23blchjVuEWZwpSvDOXttEmJlgA3rPtyWFy08MPh1f5vzdWjdtGU44u7N1GQzIZS7ZVgFKiaWPS6xfN/CR2XSF5xEPLiYr2Af4nGFzhV9GxHpGJushOshhQd6vm0wjY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518335; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YeewIYlqDUtRpasqAWP1LkKbfuk6/sOHHHhagHP4Nhg=; b=cYkQ3Ii+Y0u/1AL/Sb5bfnV2kwY420+i8/TDFy3IhtwCQ6wvGULUeqiecruTeLmDDmsXiP3iPsIyJOmGL73oULJLQrwq0fkdqtMRg+fhgAwkmiiTKvA5zDHHOURaCBnLFKLSGXWKeizN2uVxoQG2l5nSOaS90slFHGY4LxxEzQY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518335141507.83650541463965; Wed, 6 Oct 2021 04:05:35 -0700 (PDT) Received: from localhost ([::1]:44284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4ju-0004lL-6e for importer@patchew.org; Wed, 06 Oct 2021 07:05:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eN-0008O4-Gx for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eL-00067y-QX for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:51 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-63-p9tn0s4jOLO-zDtDG8HTlA-1; Wed, 06 Oct 2021 06:59:45 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D717D1084683; Wed, 6 Oct 2021 10:59:44 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC58060BE5; Wed, 6 Oct 2021 10:59:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633517989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YeewIYlqDUtRpasqAWP1LkKbfuk6/sOHHHhagHP4Nhg=; b=cTSRHR6ONbVcmjSGi5n46C7yFfGZG8eF9hYpgvYu2FFXGVutQEEQOC0rxbiKv9lkncF01E Jgcx7NfqozRZas5paGSQ0XPZvf1sLl1gVq3e67dmCqHPmb5/aA0cabEyoruKi7blUrKoQ1 uRaVbdLK9Q5lmsZAYbziuinamRDz3Qc= X-MC-Unique: p9tn0s4jOLO-zDtDG8HTlA-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 05/13] block: bdrv_insert_node(): doc and style Date: Wed, 6 Oct 2021 12:59:15 +0200 Message-Id: <20211006105923.223549-6-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518336215100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy - options & flags is common pair for open-like functions, let's use it - add a comment that specifies use of @options Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210920115538.264372-4-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- block.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 5d49188073..3a90407b83 100644 --- a/block.c +++ b/block.c @@ -5119,14 +5119,23 @@ static void bdrv_delete(BlockDriverState *bs) g_free(bs); } =20 -BlockDriverState *bdrv_insert_node(BlockDriverState *bs, QDict *node_optio= ns, + +/* + * Replace @bs by newly created block node. + * + * @options is a QDict of options to pass to the block drivers, or NULL fo= r an + * empty set of options. The reference to the QDict belongs to the block l= ayer + * after the call (even on failure), so if the caller intends to reuse the + * dictionary, it needs to use qobject_ref() before calling bdrv_open. + */ +BlockDriverState *bdrv_insert_node(BlockDriverState *bs, QDict *options, int flags, Error **errp) { ERRP_GUARD(); int ret; BlockDriverState *new_node_bs; =20 - new_node_bs =3D bdrv_open(NULL, NULL, node_options, flags, errp); + new_node_bs =3D bdrv_open(NULL, NULL, options, flags, errp); if (new_node_bs =3D=3D NULL) { error_prepend(errp, "Could not create node: "); return NULL; --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518523; cv=none; d=zohomail.com; s=zohoarc; b=fBEshNWXlcgV6hxZE2foTYGYEDRND+WU/MCIAchk4wZFjlB0w7YCraI2aXdtZP8MzpyLj4DhJTKTPJPJe/5JzQDqBpKIs/P+U6D5bpaUqSkdOOOOSA9/E82BdSAwKsLCMmDpUEpy2sh2K/VIIXkahRzHOc/hJjW4NXIK+QC/9Uc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518523; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aJlefR5PlnEMEY42gWpyOpsNck+2k5yLR/hav3y7Zvk=; b=ZrvM212GB9dZzr3o//YidnwfH5Fvyz8hnMj5gYaaCossKU5yCI7g1wvvQPISHlgVPe1Bq1XU2//d6wSW+0ciHYQjzDXynB1W1BoXNSupx1WM7nO61LlMiGT9XwomAMLz7swcOO+vsmCltAN7IpHN8vxm+S6Zl0mtCHTFTuMDl9g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518523497333.9601569345466; Wed, 6 Oct 2021 04:08:43 -0700 (PDT) Received: from localhost ([::1]:52070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4mt-0001zL-8P for importer@patchew.org; Wed, 06 Oct 2021 07:08:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eO-0008PF-2w for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eM-00068X-99 for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:51 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-553-HAeiBhdzMpSSKfjZx8OzFg-1; Wed, 06 Oct 2021 06:59:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 70D76362F9; Wed, 6 Oct 2021 10:59:47 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C4C160BE5; Wed, 6 Oct 2021 10:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633517989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aJlefR5PlnEMEY42gWpyOpsNck+2k5yLR/hav3y7Zvk=; b=V3mmrwTLhrzpRurCZVsozpAvR9IPDB5DbdCIq4Y4ci++R0fjAWv2KQCKsqK/pnUaRw0SHw PnffySnbkJGhVsOJLunv25HY11H1YH8g0muR4htXOYjcq6plScXl0735COcQUzb1oLQr2F 9CLEq3rGSsxiAfTDP0TQhIeOfT9Eu8g= X-MC-Unique: HAeiBhdzMpSSKfjZx8OzFg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 06/13] block: bdrv_insert_node(): don't use bdrv_open() Date: Wed, 6 Oct 2021 12:59:16 +0200 Message-Id: <20211006105923.223549-7-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518523929100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Use bdrv_new_open_driver_opts() instead of complicated bdrv_open(). Among other extra things bdrv_open() also check for white-listed formats, which we don't want for internal node creation: currently backup doesn't work when copy-before-write filter is not white-listed. As well block-stream doesn't work when copy-on-read is not white-listed. Fixes: 751cec7a261adaf1145dc7adf6de7c9c084e5a0b Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=3D2004812 Reported-by: Yanan Fu Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210920115538.264372-5-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- block.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index 3a90407b83..45f653a88b 100644 --- a/block.c +++ b/block.c @@ -5133,12 +5133,30 @@ BlockDriverState *bdrv_insert_node(BlockDriverState= *bs, QDict *options, { ERRP_GUARD(); int ret; - BlockDriverState *new_node_bs; + BlockDriverState *new_node_bs =3D NULL; + const char *drvname, *node_name; + BlockDriver *drv; + + drvname =3D qdict_get_try_str(options, "driver"); + if (!drvname) { + error_setg(errp, "driver is not specified"); + goto fail; + } + + drv =3D bdrv_find_format(drvname); + if (!drv) { + error_setg(errp, "Unknown driver: '%s'", drvname); + goto fail; + } =20 - new_node_bs =3D bdrv_open(NULL, NULL, options, flags, errp); - if (new_node_bs =3D=3D NULL) { + node_name =3D qdict_get_try_str(options, "node-name"); + + new_node_bs =3D bdrv_new_open_driver_opts(drv, node_name, options, fla= gs, + errp); + options =3D NULL; /* bdrv_new_open_driver() eats options */ + if (!new_node_bs) { error_prepend(errp, "Could not create node: "); - return NULL; + goto fail; } =20 bdrv_drained_begin(bs); @@ -5147,11 +5165,15 @@ BlockDriverState *bdrv_insert_node(BlockDriverState= *bs, QDict *options, =20 if (ret < 0) { error_prepend(errp, "Could not replace node: "); - bdrv_unref(new_node_bs); - return NULL; + goto fail; } =20 return new_node_bs; + +fail: + qobject_unref(options); + bdrv_unref(new_node_bs); + return NULL; } =20 /* --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518734; cv=none; d=zohomail.com; s=zohoarc; b=kioaGFxdiVykKidYXTZ4OE++lmcnTHchQvqq4FSs5l7HhFNTej0NLyyppowE3wLXamLy8mECnDVhFVbfMpWwipTi8JIHnjeyY9pXIJ9h63luJLBio/dzLbfXCL06Ds2yQi7DyXkfp+FDaV6CKVjQ3vgIwEmsrvWQP0qqTum9Ek0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518734; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/QjyK1b7LhFSx1aONvW3W7VMkQJMnB6Nqb96OENlfHc=; b=dQhut4kPTaXJOCs7u9bn1qw3TRcCXehTQYrIZCemCpS0BGvGFWMWBG93OHxKoWk6K4nQ7F/z1uoZtvhyjWwSQS6mxnIofLVTWeV7LPSNXw1Sn4xsAXzcCC3pkl8/Dru6QKvlPdHzEN3WaW8U+F/5GjNoLtbi7R9b7yMMKM28fxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518734486835.9409404354258; Wed, 6 Oct 2021 04:12:14 -0700 (PDT) Received: from localhost ([::1]:58346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4qL-0006x0-HQ for importer@patchew.org; Wed, 06 Oct 2021 07:12:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eS-0000C3-LC for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eR-0006CQ-4a for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:56 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-o0ozH9VjNMOucVq0wtaXIg-1; Wed, 06 Oct 2021 06:59:53 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4450D8015C7; Wed, 6 Oct 2021 10:59:52 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7C9D60BE5; Wed, 6 Oct 2021 10:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633517994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/QjyK1b7LhFSx1aONvW3W7VMkQJMnB6Nqb96OENlfHc=; b=Lif49XhjDuThwdOv3Q3ueQcLN2cwg+T8jk7Z2B57cWjDCSItLaEH1V970ZyD8bTo7LLAWJ j8N4yOCOdvkyaacESzU8cF2BUjaFzBIOwFKfE4uHnnrrMMvCuPy6HauXWZZ9yWSoywl/MV RhUbMY9TLBT/Bh1lZtTpE0Wn2ejh9i4= X-MC-Unique: o0ozH9VjNMOucVq0wtaXIg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 07/13] iotests/image-fleecing: declare requirement of copy-before-write Date: Wed, 6 Oct 2021 12:59:17 +0200 Message-Id: <20211006105923.223549-8-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518734815100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Now test fails if copy-before-write is not white-listed. Let's skip test instead. Fixes: c0605985696a19ef034fa25d04f53f3b3b383896 Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210920115538.264372-6-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/image-fleecing | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/t= ests/image-fleecing index f6318492c6..35164e9036 100755 --- a/tests/qemu-iotests/tests/image-fleecing +++ b/tests/qemu-iotests/tests/image-fleecing @@ -28,6 +28,7 @@ from iotests import log, qemu_img, qemu_io, qemu_io_silent iotests.script_initialize( supported_fmts=3D['qcow2', 'qcow', 'qed', 'vmdk', 'vhdx', 'raw'], supported_platforms=3D['linux'], + required_fmts=3D['copy-before-write'], ) =20 patterns =3D [('0x5d', '0', '64k'), --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518829; cv=none; d=zohomail.com; s=zohoarc; b=cJ3Lbfr5kESU91psacdYQBrooU8Z8tPEVzETeN6ZkvySrnleacKoCh4/VJPU4yP8P0wwD1yi8dxq71A4JYssxyXFeBVIHtzNWAe6g/jnNyJ8FW2eQmcKeiA198IuiYaPJA/R6f53a1FgTJEG8RiievC5Xa9PJVtf9TrXh0WzDZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518829; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t2K7wwe6cos0Co9SCrHEDafO0i6pzgkz97OSYuikjPM=; b=lGKgGldK7/XIGPBiMstpsJ6DvuNEnaQE9nq0nLcnz1h6xGaPpVCvce5VzMBNMbK4nQqsx9FIeshCkFUyeQ9SFTL+MQCsYXeFDuHI52JKW0NJgy9erzEAjhcgtiPYWkM0IMKNwouRQumKj52ZMNaYmqOlTFZYofM9kW8rrF/8GVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518829676832.6402139249832; Wed, 6 Oct 2021 04:13:49 -0700 (PDT) Received: from localhost ([::1]:34462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4rs-0001Zy-M5 for importer@patchew.org; Wed, 06 Oct 2021 07:13:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eV-0000JZ-Gt for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eT-0006En-Ot for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:59:59 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-567-euMNRmilPLyNWLXF9JCYig-1; Wed, 06 Oct 2021 06:59:55 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CED9D835DE1; Wed, 6 Oct 2021 10:59:54 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DF9760BE5; Wed, 6 Oct 2021 10:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633517997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t2K7wwe6cos0Co9SCrHEDafO0i6pzgkz97OSYuikjPM=; b=NjOMovpvNFcrwJDACX46EhlsXjRdDuR1qZTPX/Ac/w8iyb+jrb6TwVurlnfE1A7N5fJKzq GrZXU6IjDzkwWxPijOyOL/H904TKWiuTSiGZKFQ4CH9HHwyU9sSyA5jR1sCoD+x9dYYTbe OVWUONdhVp4h/l/OlGRs27F7VOEkbFk= X-MC-Unique: euMNRmilPLyNWLXF9JCYig-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 08/13] block: introduce max_hw_iov for use in scsi-generic Date: Wed, 6 Oct 2021 12:59:18 +0200 Message-Id: <20211006105923.223549-9-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518831489100005 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Linux limits the size of iovecs to 1024 (UIO_MAXIOV in the kernel sources, IOV_MAX in POSIX). Because of this, on some host adapters requests with many iovecs are rejected with -EINVAL by the io_submit() or readv()/writev() system calls. In fact, the same limit applies to SG_IO as well. To fix both the EINVAL and the possible performance issues from using fewer iovecs than allowed by Linux (some HBAs have max_segments as low as 128), introduce a separate entry in BlockLimits to hold the max_segments value from sysfs. This new limit is used only for SG_IO and clamped to bs->bl.max_iov anyway, just like max_hw_transfer is clamped to bs->bl.max_transfer. Reported-by: Halil Pasic Cc: Hanna Reitz Cc: Kevin Wolf Cc: qemu-block@nongnu.org Cc: qemu-stable@nongnu.org Fixes: 18473467d5 ("file-posix: try BLKSECTGET on block devices too, do not= round to power of 2", 2021-06-25) Signed-off-by: Paolo Bonzini Message-Id: <20210923130436.1187591-1-pbonzini@redhat.com> Signed-off-by: Kevin Wolf --- include/block/block_int.h | 7 +++++++ include/sysemu/block-backend.h | 1 + block/block-backend.c | 6 ++++++ block/file-posix.c | 2 +- block/io.c | 1 + hw/scsi/scsi-generic.c | 2 +- 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index ffe86068d4..f4c75e8ba9 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -718,6 +718,13 @@ typedef struct BlockLimits { */ uint64_t max_hw_transfer; =20 + /* Maximal number of scatter/gather elements allowed by the hardware. + * Applies whenever transfers to the device bypass the kernel I/O + * scheduler, for example with SG_IO. If larger than max_iov + * or if zero, blk_get_max_hw_iov will fall back to max_iov. + */ + int max_hw_iov; + /* memory alignment, in bytes so that no bounce buffer is needed */ size_t min_mem_alignment; =20 diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 29d4fdbf63..82bae55161 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -211,6 +211,7 @@ uint32_t blk_get_request_alignment(BlockBackend *blk); uint32_t blk_get_max_transfer(BlockBackend *blk); uint64_t blk_get_max_hw_transfer(BlockBackend *blk); int blk_get_max_iov(BlockBackend *blk); +int blk_get_max_hw_iov(BlockBackend *blk); void blk_set_guest_block_size(BlockBackend *blk, int align); void *blk_try_blockalign(BlockBackend *blk, size_t size); void *blk_blockalign(BlockBackend *blk, size_t size); diff --git a/block/block-backend.c b/block/block-backend.c index 6140d133e2..ba2b5ebb10 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1986,6 +1986,12 @@ uint32_t blk_get_max_transfer(BlockBackend *blk) return ROUND_DOWN(max, blk_get_request_alignment(blk)); } =20 +int blk_get_max_hw_iov(BlockBackend *blk) +{ + return MIN_NON_ZERO(blk->root->bs->bl.max_hw_iov, + blk->root->bs->bl.max_iov); +} + int blk_get_max_iov(BlockBackend *blk) { return blk->root->bs->bl.max_iov; diff --git a/block/file-posix.c b/block/file-posix.c index c62e42743d..53be0bdc1b 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1273,7 +1273,7 @@ static void raw_refresh_limits(BlockDriverState *bs, = Error **errp) =20 ret =3D hdev_get_max_segments(s->fd, &st); if (ret > 0) { - bs->bl.max_iov =3D ret; + bs->bl.max_hw_iov =3D ret; } } } diff --git a/block/io.c b/block/io.c index 18d345a87a..bb0a254def 100644 --- a/block/io.c +++ b/block/io.c @@ -136,6 +136,7 @@ static void bdrv_merge_limits(BlockLimits *dst, const B= lockLimits *src) dst->min_mem_alignment =3D MAX(dst->min_mem_alignment, src->min_mem_alignment); dst->max_iov =3D MIN_NON_ZERO(dst->max_iov, src->max_iov); + dst->max_hw_iov =3D MIN_NON_ZERO(dst->max_hw_iov, src->max_hw_iov); } =20 typedef struct BdrvRefreshLimitsState { diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index 665baf900e..0306ccc7b1 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -180,7 +180,7 @@ static int scsi_handle_inquiry_reply(SCSIGenericReq *r,= SCSIDevice *s, int len) page =3D r->req.cmd.buf[2]; if (page =3D=3D 0xb0) { uint64_t max_transfer =3D blk_get_max_hw_transfer(s->conf.blk); - uint32_t max_iov =3D blk_get_max_iov(s->conf.blk); + uint32_t max_iov =3D blk_get_max_hw_iov(s->conf.blk); =20 assert(max_transfer); max_transfer =3D MIN_NON_ZERO(max_transfer, max_iov * qemu_rea= l_host_page_size) --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518731; cv=none; d=zohomail.com; s=zohoarc; b=cWDsGT5mBPAl5Iev4VXoDosW5q6y12JKh5t/fkdsQgWe1CJfG6XjCimKM3H2VDha6saxwVdVypdiTmfGsXKo9hZXuY8kp2Pb+apIz5gof7GhAR0OOXaOKkoGXVVRP1lliTKiLENSSw/wuI0BmlYTKgw0LL1JRlA6hTBF9kyP1ho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518731; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+CkQwcqSTqGRgsapS0Z19TmnKTc4whEPnonU7MYMai4=; b=NSIFPRq9hUB49ki4X8L9W/c20bxK3sXUiJBcwd9wTmYcbAIsurMlupS8aGQnwSIRSQSNju/Skvgr12+b6k3hDHbaG0Io0wwj1FEBHXt9tVWvfow4NvRShpkOT+Uusw/m2QziFi+8MdYGW7jkIje8xwSuGOAhGNTgTCQ0Ab98y2E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518731821702.822479006068; Wed, 6 Oct 2021 04:12:11 -0700 (PDT) Received: from localhost ([::1]:58060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4qI-0006kx-Po for importer@patchew.org; Wed, 06 Oct 2021 07:12:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eZ-0000Wx-LH for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eX-0006Hn-KF for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:03 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-160-JAfVLyi7M6GzUTskF1Kn3w-1; Wed, 06 Oct 2021 06:59:58 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A296802928; Wed, 6 Oct 2021 10:59:57 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2975C60BE5; Wed, 6 Oct 2021 10:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633518000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+CkQwcqSTqGRgsapS0Z19TmnKTc4whEPnonU7MYMai4=; b=MPefWS+MrGNtvX22JXbcet69FnJwvXB8jakhViveqWpF09J2mmSAnYHjtcyfaGg7VRlshe 5QZsfy7FniggG4fY5vVZP+2KY+IQnByXC/h/aOISJ00aYjexmX1rSsCz35PVJnSPuLd/LC rXQ5DAo4AyXiF8NVsDiuVS8B5biZfqU= X-MC-Unique: JAfVLyi7M6GzUTskF1Kn3w-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 09/13] iotests: add 'qemu' package location to PYTHONPATH in testenv Date: Wed, 6 Oct 2021 12:59:19 +0200 Message-Id: <20211006105923.223549-10-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518732544100001 From: John Snow We can drop the sys.path hacking in various places by doing this. Additionally, by doing it in one place right up top, we can print interesting warnings in case the environment does not look correct. (See next commit.) If we ever decide to change how the environment is crafted, all of the "help me find my python packages" goop is all in one place, right in one function. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf Message-Id: <20210923180715.4168522-2-jsnow@redhat.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 2 -- tests/qemu-iotests/testenv.py | 15 +++++++++------ tests/qemu-iotests/235 | 2 -- tests/qemu-iotests/297 | 6 ------ tests/qemu-iotests/300 | 5 ++--- tests/qemu-iotests/tests/mirror-top-perms | 7 +++---- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ce06cf5630..b06ad76e0c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -36,8 +36,6 @@ =20 from contextlib import contextmanager =20 -# pylint: disable=3Dimport-error, wrong-import-position -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu.machine import qtest from qemu.qmp import QMPMessage =20 diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 70da0d60c8..99a57a69f3 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -108,12 +108,15 @@ def init_directories(self) -> None: SAMPLE_IMG_DIR OUTPUT_DIR """ - self.pythonpath =3D os.getenv('PYTHONPATH') - if self.pythonpath: - self.pythonpath =3D self.source_iotests + os.pathsep + \ - self.pythonpath - else: - self.pythonpath =3D self.source_iotests + + # Path where qemu goodies live in this source tree. + qemu_srctree_path =3D Path(__file__, '../../../python').resolve() + + self.pythonpath =3D os.pathsep.join(filter(None, ( + self.source_iotests, + str(qemu_srctree_path), + os.getenv('PYTHONPATH'), + ))) =20 self.test_dir =3D os.getenv('TEST_DIR', os.path.join(os.getcwd(), 'scratch')) diff --git a/tests/qemu-iotests/235 b/tests/qemu-iotests/235 index 8aed45f9a7..4de920c380 100755 --- a/tests/qemu-iotests/235 +++ b/tests/qemu-iotests/235 @@ -24,8 +24,6 @@ import os import iotests from iotests import qemu_img_create, qemu_io, file_path, log =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) - from qemu.machine import QEMUMachine =20 iotests.script_initialize(supported_fmts=3D['qcow2']) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index b04cba5366..467b712280 100755 --- a/tests/qemu-iotests/297 +++ b/tests/qemu-iotests/297 @@ -68,12 +68,6 @@ def run_linters(): # Todo notes are fine, but fixme's or xxx's should probably just be # fixed (in tests, at least) env =3D os.environ.copy() - qemu_module_path =3D os.path.join(os.path.dirname(__file__), - '..', '..', 'python') - try: - env['PYTHONPATH'] +=3D os.pathsep + qemu_module_path - except KeyError: - env['PYTHONPATH'] =3D qemu_module_path subprocess.run(('pylint-3', '--score=3Dn', '--notes=3DFIXME,XXX', *fil= es), env=3Denv, check=3DFalse) =20 diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300 index fe94de84ed..10f9f2a8da 100755 --- a/tests/qemu-iotests/300 +++ b/tests/qemu-iotests/300 @@ -24,11 +24,10 @@ import random import re from typing import Dict, List, Optional =20 +from qemu.machine import machine + import iotests =20 -# Import qemu after iotests.py has amended sys.path -# pylint: disable=3Dwrong-import-order -from qemu.machine import machine =20 BlockBitmapMapping =3D List[Dict[str, object]] =20 diff --git a/tests/qemu-iotests/tests/mirror-top-perms b/tests/qemu-iotests= /tests/mirror-top-perms index 2fc8dd66e0..73138a0ef9 100755 --- a/tests/qemu-iotests/tests/mirror-top-perms +++ b/tests/qemu-iotests/tests/mirror-top-perms @@ -20,13 +20,12 @@ # =20 import os -import iotests -from iotests import qemu_img =20 -# Import qemu after iotests.py has amended sys.path -# pylint: disable=3Dwrong-import-order import qemu =20 +import iotests +from iotests import qemu_img + =20 image_size =3D 1 * 1024 * 1024 source =3D os.path.join(iotests.test_dir, 'source.img') --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518913; cv=none; d=zohomail.com; s=zohoarc; b=dUljtqHRJbQ9IYZQeyEk8Vy4tWv9pFZGiMR5OKxe50lSyYmPeVy1vNKWb+6ds0q/UPjync1st9Ta2Frf3ZZE/IzueuI0uHRyM6Dhl77azwfJPKvD+vzH/P5OpW3e6amAYJYO8IkUsWpsE8iUBQafDmhDbjtz9bapwBMPfKxTtEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518913; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sGwXJCtgsMBfZ3SWMmYmTKdHAsSUGa8sfMS0Kz7Sfio=; b=U2m2X3FHpZjXYGVNvv+55Fc7spCUon+afZgA1tWlezq6/6GDghzOsp6fJZsAUUArWys3X/4wnPMbs5G9Fm2XEgxuAyD9cvtXIvaPc4H4lgxctyME+v+PWcUPdyMHg16hn0ByKOhK35KjWsEOmAUogpjAuY7ZoJxlGf7ZPPHsq/s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518913446394.9831404031131; Wed, 6 Oct 2021 04:15:13 -0700 (PDT) Received: from localhost ([::1]:36706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4tE-00038w-DA for importer@patchew.org; Wed, 06 Oct 2021 07:15:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4ed-0000fh-Mz for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4eb-0006MK-3t for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:07 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-85-rSc8AAnyMw2rds5kI6ktOg-1; Wed, 06 Oct 2021 07:00:00 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABCDF362F9; Wed, 6 Oct 2021 10:59:59 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91B4F60BE5; Wed, 6 Oct 2021 10:59:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633518004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sGwXJCtgsMBfZ3SWMmYmTKdHAsSUGa8sfMS0Kz7Sfio=; b=fLGfthEsEim35WJlHnE5gj9i1g7mqVRhaqE/yVYCm1IuZlDTJ2fNLH5A3anAY4L0vDagbX DSUvtziLjLOuQUd0B3YgTY3oN98skKS1ggDT4micNPZgLPSwmsDJf7SQkux48lSs/OH6cX 4Gw28RJ0Rk4iDf42x9wbuRi9MK9uNew= X-MC-Unique: rSc8AAnyMw2rds5kI6ktOg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 10/13] iotests/linters: check mypy files all at once Date: Wed, 6 Oct 2021 12:59:20 +0200 Message-Id: <20211006105923.223549-11-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518915014100001 From: John Snow We can circumvent the '__main__' redefinition problem by passing --scripts-are-modules. Take mypy out of the loop per-filename and check everything in one go: it's quite a bit faster. Signed-off-by: John Snow Reviewed-by: Hanna Reitz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf Message-Id: <20210923180715.4168522-4-jsnow@redhat.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/297 | 46 +++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index 467b712280..91ec34d952 100755 --- a/tests/qemu-iotests/297 +++ b/tests/qemu-iotests/297 @@ -74,32 +74,28 @@ def run_linters(): print('=3D=3D=3D mypy =3D=3D=3D') sys.stdout.flush() =20 - # We have to call mypy separately for each file. Otherwise, it - # will interpret all given files as belonging together (i.e., they - # may not both define the same classes, etc.; most notably, they - # must not both define the __main__ module). env['MYPYPATH'] =3D env['PYTHONPATH'] - for filename in files: - p =3D subprocess.run(('mypy', - '--warn-unused-configs', - '--disallow-subclassing-any', - '--disallow-any-generics', - '--disallow-incomplete-defs', - '--disallow-untyped-decorators', - '--no-implicit-optional', - '--warn-redundant-casts', - '--warn-unused-ignores', - '--no-implicit-reexport', - '--namespace-packages', - filename), - env=3Denv, - check=3DFalse, - stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.STDOUT, - universal_newlines=3DTrue) - - if p.returncode !=3D 0: - print(p.stdout) + p =3D subprocess.run(('mypy', + '--warn-unused-configs', + '--disallow-subclassing-any', + '--disallow-any-generics', + '--disallow-incomplete-defs', + '--disallow-untyped-decorators', + '--no-implicit-optional', + '--warn-redundant-casts', + '--warn-unused-ignores', + '--no-implicit-reexport', + '--namespace-packages', + '--scripts-are-modules', + *files), + env=3Denv, + check=3DFalse, + stdout=3Dsubprocess.PIPE, + stderr=3Dsubprocess.STDOUT, + universal_newlines=3DTrue) + + if p.returncode !=3D 0: + print(p.stdout) =20 =20 for linter in ('pylint-3', 'mypy'): --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518948; cv=none; d=zohomail.com; s=zohoarc; b=eesl/Bwu9nwQOAjfcGdFMeS+jXs+NA4Eo/si0E+zw5Vw2X9iKsra4Seb0bXiQ1THBMqYXiDFp0PF4vAvjyJkLo+ECyQTDVUNknKzhfIBSAh1CyR0fdJogKBF4rzefjenOusaZ9oxQiichV2c6HDfN0eotAtqYIndW2DTYQFG+vc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518948; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+B649WEzI0G6/ODAbe7CsmuY7chayWN5NHzHA7+oT/A=; b=ErhSqp5tNnWTthQ1PrMRK16MgmPy2pKHzoh3gywTdFw3bOsGhq4UobW/3dHC28LaHvvpQQHyWSSQpIlYSaDsqtDOOXtjov07C84Tc8kX3CuQUOjZCvhMzdFgsH5ikj2L/B4U+QJXAmkw48BC9SkS/zxEJ3+6vrjbq7X3Ad8Ug9A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518948267602.4719938030489; Wed, 6 Oct 2021 04:15:48 -0700 (PDT) Received: from localhost ([::1]:36840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4tk-0003EX-AD for importer@patchew.org; Wed, 06 Oct 2021 07:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4ee-0000hE-52 for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4ec-0006NW-ET for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:07 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-dnh8onMJPTqJykdyl7O82A-1; Wed, 06 Oct 2021 07:00:04 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06DD0180830C; Wed, 6 Oct 2021 11:00:03 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0617B60BE5; Wed, 6 Oct 2021 10:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633518005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+B649WEzI0G6/ODAbe7CsmuY7chayWN5NHzHA7+oT/A=; b=BV9MSba/bWKRN+tO8NaFPe0bWAoAVsxc/IIe/C1LoY9Jn4/ozhRrsteVarSNsqjI4hRwtZ YIygRgnkiIBgIl0flbZD3tpgACQgxv1vrxhu5W4DTjlrOV9LSE07FqXYdVBdFsTFfRirVv Ppmxg97cuzLlEZBIHmKJAAlQ9rfZ1UU= X-MC-Unique: dnh8onMJPTqJykdyl7O82A-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 11/13] iotests/mirror-top-perms: Adjust imports Date: Wed, 6 Oct 2021 12:59:21 +0200 Message-Id: <20211006105923.223549-12-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518949125100001 From: John Snow We need to import subpackages from the qemu namespace package; importing the namespace package alone doesn't bring the subpackages with it -- unless someone else (like iotests.py) imports them too. Adjust the imports. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Hanna Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf Message-Id: <20210923180715.4168522-5-jsnow@redhat.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/mirror-top-perms | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/tests/mirror-top-perms b/tests/qemu-iotests= /tests/mirror-top-perms index 73138a0ef9..3d475aa3a5 100755 --- a/tests/qemu-iotests/tests/mirror-top-perms +++ b/tests/qemu-iotests/tests/mirror-top-perms @@ -21,7 +21,8 @@ =20 import os =20 -import qemu +from qemu import qmp +from qemu.machine import machine =20 import iotests from iotests import qemu_img @@ -46,7 +47,7 @@ class TestMirrorTopPerms(iotests.QMPTestCase): def tearDown(self): try: self.vm.shutdown() - except qemu.machine.machine.AbnormalShutdown: + except machine.AbnormalShutdown: pass =20 if self.vm_b is not None: @@ -101,7 +102,7 @@ class TestMirrorTopPerms(iotests.QMPTestCase): self.vm_b.launch() print('ERROR: VM B launched successfully, this should not have= ' 'happened') - except qemu.qmp.QMPConnectError: + except qmp.QMPConnectError: assert 'Is another process using the image' in self.vm_b.get_l= og() =20 result =3D self.vm.qmp('block-job-cancel', --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633518335; cv=none; d=zohomail.com; s=zohoarc; b=lVcOr4XPoThVRUzhWbih1u4+7iv0nkPezM/CXZnJ6damsIBsOEFhF65sKZwozrAg9Sczs9+QUv5u4nkWdnkdeKT6kvi6oqaYPtm9gyFumWlSEgvDtRU3pEhxUpr2Z/9BggABvUSKLPAD/VrW9Wc1f+4zQd3c0nQHFdJnORDEOR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633518335; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZPtjiCKVVEri6iQwWSCVij/O6XAB1ecFMaM/jNY0QkU=; b=cgdchNfcV6HOgSpXwYqA2tosSMcT+H/5u9xzNdyExzaaRJJGxq5Xzd67vJ63Hr3OSIwNyipDoxva5jLacZOeN1Gn462o2w9NisT3u1L5tuwjghDuSILRCNeEpqpZeUe36eSAiU9ORfmN85GpNA0a3iNJoJUfkFVn76hNkcppE8A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633518335352215.61245239032837; Wed, 6 Oct 2021 04:05:35 -0700 (PDT) Received: from localhost ([::1]:44316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4ju-0004mt-93 for importer@patchew.org; Wed, 06 Oct 2021 07:05:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4en-0000r2-0q for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4ei-0006Ti-Lt for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:15 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-436-Y2mfIStOM4qTIRsFniMmMQ-1; Wed, 06 Oct 2021 07:00:08 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08779802928; Wed, 6 Oct 2021 11:00:08 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 529AA60BE5; Wed, 6 Oct 2021 11:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633518012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZPtjiCKVVEri6iQwWSCVij/O6XAB1ecFMaM/jNY0QkU=; b=RpWptR0nonXH7sjsB2eYiluX8xSbDmrKuIaYHItjxG6uEltBAtdSoUEIoK9Jmyg1uWNTma kNQ7NKzwvaUjJQuJRAr+2wnk5NjKOPn98iG3jWCF5Eu2orxwpP7kD+d68GNHTktE/F/MRd deAdk8TAyQhe4eaoP685hymGRQJkPXY= X-MC-Unique: Y2mfIStOM4qTIRsFniMmMQ-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 12/13] iotests/migrate-bitmaps-test: delint Date: Wed, 6 Oct 2021 12:59:22 +0200 Message-Id: <20211006105923.223549-13-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633518336230100002 From: John Snow Mostly uninteresting stuff. Move the test injections under a function named main() so that the variables used during that process aren't in the global scope. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Hanna Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf Message-Id: <20210923180715.4168522-6-jsnow@redhat.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/migrate-bitmaps-test | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-test b/tests/qemu-iot= ests/tests/migrate-bitmaps-test index dc431c35b3..c23df3d75c 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-test @@ -19,10 +19,11 @@ # along with this program. If not, see . # =20 -import os import itertools import operator +import os import re + import iotests from iotests import qemu_img, qemu_img_create, Timeout =20 @@ -224,25 +225,6 @@ def inject_test_case(klass, suffix, method, *args, **k= wargs): setattr(klass, 'test_' + method + suffix, lambda self: mc(self)) =20 =20 -for cmb in list(itertools.product((True, False), repeat=3D5)): - name =3D ('_' if cmb[0] else '_not_') + 'persistent_' - name +=3D ('_' if cmb[1] else '_not_') + 'migbitmap_' - name +=3D '_online' if cmb[2] else '_offline' - name +=3D '_shared' if cmb[3] else '_nonshared' - if cmb[4]: - name +=3D '__pre_shutdown' - - inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migration', - *list(cmb)) - -for cmb in list(itertools.product((True, False), repeat=3D2)): - name =3D ('_' if cmb[0] else '_not_') + 'persistent_' - name +=3D ('_' if cmb[1] else '_not_') + 'migbitmap' - - inject_test_case(TestDirtyBitmapMigration, name, - 'do_test_migration_resume_source', *list(cmb)) - - class TestDirtyBitmapBackingMigration(iotests.QMPTestCase): def setUp(self): qemu_img_create('-f', iotests.imgfmt, base_a, size) @@ -304,6 +286,30 @@ class TestDirtyBitmapBackingMigration(iotests.QMPTestC= ase): self.assert_qmp(result, 'return', {}) =20 =20 +def main() -> None: + for cmb in list(itertools.product((True, False), repeat=3D5)): + name =3D ('_' if cmb[0] else '_not_') + 'persistent_' + name +=3D ('_' if cmb[1] else '_not_') + 'migbitmap_' + name +=3D '_online' if cmb[2] else '_offline' + name +=3D '_shared' if cmb[3] else '_nonshared' + if cmb[4]: + name +=3D '__pre_shutdown' + + inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migratio= n', + *list(cmb)) + + for cmb in list(itertools.product((True, False), repeat=3D2)): + name =3D ('_' if cmb[0] else '_not_') + 'persistent_' + name +=3D ('_' if cmb[1] else '_not_') + 'migbitmap' + + inject_test_case(TestDirtyBitmapMigration, name, + 'do_test_migration_resume_source', *list(cmb)) + + iotests.main( + supported_fmts=3D['qcow2'], + supported_protocols=3D['file'] + ) + + if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2'], - supported_protocols=3D['file']) + main() --=20 2.31.1 From nobody Thu May 9 14:43:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633519171; cv=none; d=zohomail.com; s=zohoarc; b=AroNN1laQeDOgowI37Rgr3uJmeslHHUbzhRVXR/v3RRJn5k5w5Yc4J/pAHwh2PpWzFIigk3Pnz7mL6iv+EypdQce2IOxqdRK70pwVMmh1R5Vgcz00D8mJGx76wYwnfoj1TqKnkyVbSykCM1HZ8+IPXAikgvn0J0A/AbGzlBSe0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633519171; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=snNxAVu7fW6ID8sHaoqM6PG8UPGOkohk42i3zANJr10=; b=lYA/lJ4Llqk7CCJ4O6TdizZlmWl4Tpy87bcps36pfgg4n4tUUQlE0xMqRgLCMzgtNf7cpGvxI95fG/BcME8KxC66Jb3vrp3ID3X450EefHUqNrdTp1FyjivJ+BcL+dMfDWlBRA8D59y0JzY34zELabGWPVXlnYpM5WpwCvcnviY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633519171315646.7868501024544; Wed, 6 Oct 2021 04:19:31 -0700 (PDT) Received: from localhost ([::1]:43782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4xO-0008Ak-1H for importer@patchew.org; Wed, 06 Oct 2021 07:19:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4fE-0000xi-9N for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4f7-0006nK-Us for qemu-devel@nongnu.org; Wed, 06 Oct 2021 07:00:40 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-nZoziBCPMpK63Ske1XuEsg-1; Wed, 06 Oct 2021 07:00:36 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E00FA802C89; Wed, 6 Oct 2021 11:00:34 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4FBE060BE5; Wed, 6 Oct 2021 11:00:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633518037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=snNxAVu7fW6ID8sHaoqM6PG8UPGOkohk42i3zANJr10=; b=Q+Av0AWzIymJfMUpyu8FVNXJN1FSM96KFdksjPHOtdVOPlzGcIMHz7qCv2k0AxAPp1IH7c c4VAzC5wN1RFHPaRY3OkGg/CfBu7bUOES2Pv0QyCP22ESGRzB9ZN1ZgP8+K7bdM0A47uKB ZDspJDqGMcKU5tOlPYORrKnFCszSON4= X-MC-Unique: nZoziBCPMpK63Ske1XuEsg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 13/13] iotests: Update for pylint 2.11.1 Date: Wed, 6 Oct 2021 12:59:23 +0200 Message-Id: <20211006105923.223549-14-kwolf@redhat.com> In-Reply-To: <20211006105923.223549-1-kwolf@redhat.com> References: <20211006105923.223549-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633519173401100001 Content-Type: text/plain; charset="utf-8" From: John Snow 1. Ignore the new f-strings warning, we're not interested in doing a full conversion at this time. 2. Just mute the unbalanced-tuple-unpacking warning, it's not a real error in this case and muting the dozens of callsites is just not worth it. 3. Add encodings to read_text(). Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf Message-Id: <20210923180715.4168522-7-jsnow@redhat.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/testrunner.py | 7 ++++--- tests/qemu-iotests/pylintrc | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunn= er.py index 4a6ec421ed..a56b6da396 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -266,12 +266,13 @@ def do_run_test(self, test: str) -> TestResult: diff=3Dfile_diff(str(f_reference), str(f_bad= ))) =20 if f_notrun.exists(): - return TestResult(status=3D'not run', - description=3Df_notrun.read_text().strip()) + return TestResult( + status=3D'not run', + description=3Df_notrun.read_text(encoding=3D'utf-8').strip= ()) =20 casenotrun =3D '' if f_casenotrun.exists(): - casenotrun =3D f_casenotrun.read_text() + casenotrun =3D f_casenotrun.read_text(encoding=3D'utf-8') =20 diff =3D file_diff(str(f_reference), str(f_bad)) if diff: diff --git a/tests/qemu-iotests/pylintrc b/tests/qemu-iotests/pylintrc index f2c0b522ac..8cb4e1d6a6 100644 --- a/tests/qemu-iotests/pylintrc +++ b/tests/qemu-iotests/pylintrc @@ -19,13 +19,17 @@ disable=3Dinvalid-name, too-many-public-methods, # pylint warns about Optional[] etc. as unsubscriptable in 3.9 unsubscriptable-object, + # pylint's static analysis causes false positivies for file_path(); + # If we really care to make it statically knowable, we'll use mypy. + unbalanced-tuple-unpacking, # Sometimes we need to disable a newly introduced pylint warning. # Doing so should not produce a warning in older versions of pylin= t. bad-option-value, # These are temporary, and should be removed: missing-docstring, too-many-return-statements, - too-many-statements + too-many-statements, + consider-using-f-string, =20 [FORMAT] =20 --=20 2.31.1