[PATCH v3 for-4.2 0/4] Better NBD string length handling

Eric Blake posted 4 patches 4 years, 5 months ago
Test asan passed
Test checkpatch passed
Test FreeBSD passed
Test docker-mingw@fedora failed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20191114024635.11363-1-eblake@redhat.com
Maintainers: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>, Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>, Max Reitz <mreitz@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, John Snow <jsnow@redhat.com>
qapi/block-core.json         |  2 +-
qapi/block.json              |  9 +++++---
include/block/dirty-bitmap.h |  2 ++
include/block/nbd.h          | 12 +++++-----
block/dirty-bitmap.c         | 12 +++++++---
block/nbd.c                  | 10 +++++++++
block/qcow2-bitmap.c         |  2 ++
blockdev-nbd.c               | 14 +++++++++++-
monitor/hmp-cmds.c           |  4 ++--
nbd/client.c                 | 18 ++++++++++++---
nbd/server.c                 | 43 ++++++++++++++++++++++++------------
qemu-nbd.c                   |  9 ++++++++
tests/qemu-iotests/223       |  2 +-
tests/qemu-iotests/223.out   |  1 +
14 files changed, 106 insertions(+), 34 deletions(-)
[PATCH v3 for-4.2 0/4] Better NBD string length handling
Posted by Eric Blake 4 years, 5 months ago
This series was originally posted before soft freeze, but then KVM
Forum interfered. I think that patches 1-3 are bug fixes still
appropriate for -rc2 if they get good reviews, but patch 4 is a new
feature and now only appropriate for 5.0.

Since v2:
- Patch 1, 2: new [Vladimir]
- Patch 3: improve error messages and fix a memleak [Vladimir]
- Patch 3: bump name length from 256 to 4k (R-b dropped)
- Patch 4: add R-b, but tweak to defer to 5.0

Eric Blake (4):
  nbd/server: Prefer heap over stack for parsing client names
  bitmap: Enforce maximum bitmap name length
  nbd: Don't send oversize strings
  nbd: Allow description when creating NBD blockdev

 qapi/block-core.json         |  2 +-
 qapi/block.json              |  9 +++++---
 include/block/dirty-bitmap.h |  2 ++
 include/block/nbd.h          | 12 +++++-----
 block/dirty-bitmap.c         | 12 +++++++---
 block/nbd.c                  | 10 +++++++++
 block/qcow2-bitmap.c         |  2 ++
 blockdev-nbd.c               | 14 +++++++++++-
 monitor/hmp-cmds.c           |  4 ++--
 nbd/client.c                 | 18 ++++++++++++---
 nbd/server.c                 | 43 ++++++++++++++++++++++++------------
 qemu-nbd.c                   |  9 ++++++++
 tests/qemu-iotests/223       |  2 +-
 tests/qemu-iotests/223.out   |  1 +
 14 files changed, 106 insertions(+), 34 deletions(-)

-- 
2.21.0


Re: [PATCH v3 for-4.2 0/4] Better NBD string length handling
Posted by no-reply@patchew.org 4 years, 5 months ago
Patchew URL: https://patchew.org/QEMU/20191114024635.11363-1-eblake@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

                 from /tmp/qemu-test/src/include/qemu/osdep.h:140,
                 from /tmp/qemu-test/src/nbd/server.c:20:
/tmp/qemu-test/src/nbd/server.c: In function 'nbd_negotiate_handle_export_name':
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:10: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   g_free (*pp);
          ^
/tmp/qemu-test/src/nbd/server.c:435:22: note: 'name' was declared here
     g_autofree char *name;
                      ^
cc1: all warnings being treated as errors
make: *** [nbd/server.o] Error 1
make: *** Waiting for unfinished jobs....
  CC      chardev/char-file.o
  CC      chardev/char-io.o
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=9620816161004b4c84746eaba688af5a', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-gsxzfw9n/src/docker-src.2019-11-13-21.55.21.14727:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=9620816161004b4c84746eaba688af5a
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-gsxzfw9n/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    2m9.489s
user    0m7.589s


The full log is available at
http://patchew.org/logs/20191114024635.11363-1-eblake@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH v3 for-4.2 0/4] Better NBD string length handling
Posted by no-reply@patchew.org 4 years, 5 months ago
Patchew URL: https://patchew.org/QEMU/20191114024635.11363-1-eblake@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

                 from /tmp/qemu-test/src/include/qemu/osdep.h:140,
                 from /tmp/qemu-test/src/nbd/server.c:20:
/tmp/qemu-test/src/nbd/server.c: In function 'nbd_negotiate_handle_export_name':
/usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   g_free (*pp);
   ^~~~~~~~~~~~
/tmp/qemu-test/src/nbd/server.c:435:22: note: 'name' was declared here
     g_autofree char *name;
                      ^~~~
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: nbd/server.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 662, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=960f572775044fbdbd74adcaff59712e', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-07kxi3y_/src/docker-src.2019-11-13-21.57.58.24536:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=960f572775044fbdbd74adcaff59712e
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-07kxi3y_/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    2m33.836s
user    0m7.592s


The full log is available at
http://patchew.org/logs/20191114024635.11363-1-eblake@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH v3 for-4.2 0/4] Better NBD string length handling
Posted by Eric Blake 4 years, 5 months ago
On 11/13/19 9:00 PM, no-reply@patchew.org wrote:
> Patchew URL: https://patchew.org/QEMU/20191114024635.11363-1-eblake@redhat.com/
> 

> 
>                   from /tmp/qemu-test/src/include/qemu/osdep.h:140,
>                   from /tmp/qemu-test/src/nbd/server.c:20:
> /tmp/qemu-test/src/nbd/server.c: In function 'nbd_negotiate_handle_export_name':
> /usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>     g_free (*pp);
>     ^~~~~~~~~~~~
> /tmp/qemu-test/src/nbd/server.c:435:22: note: 'name' was declared here
>       g_autofree char *name;
>                        ^~~~

Ha - I posted the fix to that one minute before patchew flagged it. 
Still, I'm not sure why my gcc didn't flag this locally, while the mingw 
builder did.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org