qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/2] NBD patches for -rc2, 2020-11-16
@ 2020-11-16 20:59 Eric Blake
  2020-11-16 20:59 ` [PULL 1/2] nbd: Silence Coverity false positive Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Blake @ 2020-11-16 20:59 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit cb5ed407a1ddadf788fd373fed41c87c9e81e5b0:

  Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-11-15' into staging (2020-11-16 17:00:36 +0000)

are available in the Git repository at:

  https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2020-11-16

for you to fetch changes up to 2f3c1fd39668b9e565a4e0ba1d62ff5db05d62a5:

  iotests: Replace deprecated ConfigParser.readfp() (2020-11-16 14:51:12 -0600)

----------------------------------------------------------------
nbd patches for 2020-11-16

- silence Coverity false positive
- modernize iotests python code related to nbd

----------------------------------------------------------------
Eric Blake (1):
      nbd: Silence Coverity false positive

Kevin Wolf (1):
      iotests: Replace deprecated ConfigParser.readfp()

 nbd/server.c                             | 4 ++--
 tests/qemu-iotests/nbd-fault-injector.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.28.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PULL 1/2] nbd: Silence Coverity false positive
  2020-11-16 20:59 [PULL 0/2] NBD patches for -rc2, 2020-11-16 Eric Blake
@ 2020-11-16 20:59 ` Eric Blake
  2020-11-16 20:59 ` [PULL 2/2] iotests: Replace deprecated ConfigParser.readfp() Eric Blake
  2020-11-17 11:48 ` [PULL 0/2] NBD patches for -rc2, 2020-11-16 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2020-11-16 20:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, open list:Network Block Dev...

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 <eblake@redhat.com>
Message-Id: <20201111163510.713855-1-eblake@redhat.com>
[eblake: Prefer cast to void over odd && usage]
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 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);
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PULL 2/2] iotests: Replace deprecated ConfigParser.readfp()
  2020-11-16 20:59 [PULL 0/2] NBD patches for -rc2, 2020-11-16 Eric Blake
  2020-11-16 20:59 ` [PULL 1/2] nbd: Silence Coverity false positive Eric Blake
@ 2020-11-16 20:59 ` Eric Blake
  2020-11-17 11:48 ` [PULL 0/2] NBD patches for -rc2, 2020-11-16 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2020-11-16 20:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Philippe Mathieu-Daudé,
	open list:Block layer core, Max Reitz

From: Kevin Wolf <kwolf@redhat.com>

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 <kwolf@redhat.com>
Message-Id: <20201113100602.15936-1-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 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 = 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):
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PULL 0/2] NBD patches for -rc2, 2020-11-16
  2020-11-16 20:59 [PULL 0/2] NBD patches for -rc2, 2020-11-16 Eric Blake
  2020-11-16 20:59 ` [PULL 1/2] nbd: Silence Coverity false positive Eric Blake
  2020-11-16 20:59 ` [PULL 2/2] iotests: Replace deprecated ConfigParser.readfp() Eric Blake
@ 2020-11-17 11:48 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2020-11-17 11:48 UTC (permalink / raw)
  To: Eric Blake; +Cc: QEMU Developers

On Mon, 16 Nov 2020 at 21:06, Eric Blake <eblake@redhat.com> wrote:
>
> The following changes since commit cb5ed407a1ddadf788fd373fed41c87c9e81e5b0:
>
>   Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-11-15' into staging (2020-11-16 17:00:36 +0000)
>
> are available in the Git repository at:
>
>   https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2020-11-16
>
> for you to fetch changes up to 2f3c1fd39668b9e565a4e0ba1d62ff5db05d62a5:
>
>   iotests: Replace deprecated ConfigParser.readfp() (2020-11-16 14:51:12 -0600)
>
> ----------------------------------------------------------------
> nbd patches for 2020-11-16
>
> - silence Coverity false positive
> - modernize iotests python code related to nbd
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-17 11:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-16 20:59 [PULL 0/2] NBD patches for -rc2, 2020-11-16 Eric Blake
2020-11-16 20:59 ` [PULL 1/2] nbd: Silence Coverity false positive Eric Blake
2020-11-16 20:59 ` [PULL 2/2] iotests: Replace deprecated ConfigParser.readfp() Eric Blake
2020-11-17 11:48 ` [PULL 0/2] NBD patches for -rc2, 2020-11-16 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).