From nobody Sat Sep 21 00:59:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605560757; cv=none; d=zohomail.com; s=zohoarc; b=bgSO35my7Xe1f+xaR3WsNiiikHwc0DiCPLSrHr6Z2j3QzvtCjXT1eI/6chY81ViqffbTBuz8JUwD1mIXNrKExKs+EIV5PxxYHAHps+0XlswypPkawMXPsAlBGzfLsJv51VLocZz9dmpinunpNmATXBxhP/Ydlbz1eMEwf1VmnVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605560757; 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=V11KLkqw+wmdHrH3OZZvJC1E55fFJqwEQfjgvVj/53M=; b=m4ZnnY0fpY3W+bvq6gQAfvvo9B2rKVdNr8uwSL0HN/am1oktT89tyzkC/g6C0jbgmlSaI5gC4oGf9Dbsm7V1FZBOpkc02PrIBsf6Ctna5KQYqtF96gnOzUUbSTznwfUk1FmyK687rPZ0r5HjWSlTJ5wQx6vAsA59gIUr7pP0BC8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605560757522650.0413750778548; Mon, 16 Nov 2020 13:05:57 -0800 (PST) Received: from localhost ([::1]:46294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kelhD-0008WD-VQ for importer@patchew.org; Mon, 16 Nov 2020 16:05:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kelbT-0004H9-F9 for qemu-devel@nongnu.org; Mon, 16 Nov 2020 16:00:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kelbN-0000KE-86 for qemu-devel@nongnu.org; Mon, 16 Nov 2020 15:59:58 -0500 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-205-KiHS0AK-O0WydrrY7Fx5oQ-1; Mon, 16 Nov 2020 15:59:46 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F285A8015A3; Mon, 16 Nov 2020 20:59:44 +0000 (UTC) Received: from blue.redhat.com (ovpn-113-36.phx2.redhat.com [10.3.113.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id A369119C66; Mon, 16 Nov 2020 20:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605560389; 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=V11KLkqw+wmdHrH3OZZvJC1E55fFJqwEQfjgvVj/53M=; b=LWUq6+ZFRpxbnMuQs+iaVfmJWD6P7IYnkv3pJgvZHK+3oM9qQCWx0pbl21JPFtQGC6gK+t UKgGWNfnGCY6hzKxcPpvnOskSUSbmAvXJYhbq6G1mAIu/04p78cGnmwj+Ie9IWVh3Zyc1I gbPuTq8r5Y7LNoH+hVFcuF6co4vHlYA= X-MC-Unique: KiHS0AK-O0WydrrY7Fx5oQ-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 1/2] nbd: Silence Coverity false positive Date: Mon, 16 Nov 2020 14:59:41 -0600 Message-Id: <20201116205942.109534-2-eblake@redhat.com> In-Reply-To: <20201116205942.109534-1-eblake@redhat.com> References: <20201116205942.109534-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eblake@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=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/15 22:35:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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: Richard Henderson , "open list:Network Block Dev..." Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Coverity noticed (CID 1436125) that we check the return value of nbd_extent_array_add in most places, but not at the end of bitmap_to_extents(). The return value exists to break loops before a future iteration, so there is nothing to check if we are already done iterating. Adding a cast to void, plus a comment why, pacifies Coverity. Signed-off-by: Eric Blake Message-Id: <20201111163510.713855-1-eblake@redhat.com> [eblake: Prefer cast to void over odd && usage] Reviewed-by: Richard Henderson --- nbd/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index d145e1a69083..613ed2634ada 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -2129,8 +2129,8 @@ static void bitmap_to_extents(BdrvDirtyBitmap *bitmap, } if (!full) { - /* last non dirty extent */ - nbd_extent_array_add(es, end - start, 0); + /* last non dirty extent, nothing to do if array is now full */ + (void) nbd_extent_array_add(es, end - start, 0); } bdrv_dirty_bitmap_unlock(bitmap); --=20 2.28.0 From nobody Sat Sep 21 00:59:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605560639; cv=none; d=zohomail.com; s=zohoarc; b=JaHbiHCYMSwxy4EwxaOr+iYaYHoMoISN4yF09IMtBmhP/EFw2hCnZWPld8leXg0aWU+XlPPRmq22KyTRD7Y9TC0YnlohQmmnV52tR8pn6FMaMI4AdkRmNAUHjVtDOZdcjRviYoj4eCaslb5jtDKToJsDpiS7jJhobc0We08lexA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605560639; 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=f220quIdy0E+EGLlKKHj7SxQ8yzPLXoku/apdxR++nw=; b=ntiTSmJILtosej53bW85SZO/tGlHZ20MyQfw97aPypS1n1DtUwL7hBSBlEC5QeVEnqR4v7sXbQ60eQW7g/paxJmrOuAYmEIyWDqLSebojADOBAibJ2n83xBlEgHHVCZASaSCsVqPXTSGPoExM5pQOEevnt2h2rJ1G3f4K24+LJM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605560639027288.65267028180153; Mon, 16 Nov 2020 13:03:59 -0800 (PST) Received: from localhost ([::1]:42844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kelfJ-00071f-HG for importer@patchew.org; Mon, 16 Nov 2020 16:03:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kelbZ-0004LB-B5 for qemu-devel@nongnu.org; Mon, 16 Nov 2020 16:00:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kelbQ-0000KP-E1 for qemu-devel@nongnu.org; Mon, 16 Nov 2020 16:00:05 -0500 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-532-pgVmFDCoNA2p4kJcC-QyUA-1; Mon, 16 Nov 2020 15:59:46 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 96B57100855D; Mon, 16 Nov 2020 20:59:45 +0000 (UTC) Received: from blue.redhat.com (ovpn-113-36.phx2.redhat.com [10.3.113.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 265AA19C66; Mon, 16 Nov 2020 20:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605560390; 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=f220quIdy0E+EGLlKKHj7SxQ8yzPLXoku/apdxR++nw=; b=EIcWpItfMUS6/daT3RV62Jkqen4JV0JqJdgqtf/u/QIs1Xqx6f9bJVSudq3Dqs3as8P9Wo OddT4zJpbUPK65l/SIgHJIfHLJ2hqIjypy6fDf+honU89VCTsKT4II6nT5z+rb9ziRZ4ro m26zkMqFKmV6mQh8XBTD1chXe39VIZ0= X-MC-Unique: pgVmFDCoNA2p4kJcC-QyUA-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 2/2] iotests: Replace deprecated ConfigParser.readfp() Date: Mon, 16 Nov 2020 14:59:42 -0600 Message-Id: <20201116205942.109534-3-eblake@redhat.com> In-Reply-To: <20201116205942.109534-1-eblake@redhat.com> References: <20201116205942.109534-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eblake@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=63.128.21.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/16 04:46:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=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: Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Kevin Wolf iotest 277 fails on Fedora 33 (Python 3.9) because a deprecation warning changes the output: nbd-fault-injector.py:230: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead. In fact, readfp() has already been deprecated in Python 3.2 and the replacement has existed since the same version, so we can now unconditionally switch to read_file(). Signed-off-by: Kevin Wolf Message-Id: <20201113100602.15936-1-kwolf@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Eric Blake --- tests/qemu-iotests/nbd-fault-injector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/= nbd-fault-injector.py index 78f42c421432..6e11ef89b8b3 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -227,7 +227,7 @@ def parse_config(config): def load_rules(filename): config =3D configparser.RawConfigParser() with open(filename, 'rt') as f: - config.readfp(f, filename) + config.read_file(f, filename) return parse_config(config) def open_socket(path): --=20 2.28.0