mbox

[PULL,v2,00/42] Block layer patches and object-add QAPIfication

Message ID 20210315123520.118752-1-kwolf@redhat.com (mailing list archive)
State New, archived
Headers show

Pull-request

git://repo.or.cz/qemu/kevin.git tags/for-upstream

Message

Kevin Wolf March 15, 2021, 12:35 p.m. UTC
The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:

  Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging (2021-03-14 17:47:49 +0000)

are available in the Git repository at:

  git://repo.or.cz/qemu/kevin.git tags/for-upstream

for you to fetch changes up to 078ee48ef7d172df1b3ad020255d1eb6beda2daf:

  qom: Support JSON in HMP object_add and tools --object (2021-03-15 13:04:27 +0100)

----------------------------------------------------------------
Block layer patches and object-add QAPIfication

- QAPIfy object-add and --object for tools (keyval and JSON support)
- Add vhost-user-blk-test
- stream: Fail gracefully if permission is denied
- storage-daemon: Fix crash on quit when job is still running
- curl: Fix use after free
- char: Deprecate backend aliases, fix QMP query-chardev-backends
- Fix image creation option defaults that exist in both the format and
  the protocol layer (e.g. 'cluster_size' in qcow2 and rbd; the qcow2
  default was incorrectly applied to the rbd layer)

----------------------------------------------------------------
Coiby Xu (1):
      test: new qTest case to test the vhost-user-blk-server

Kevin Wolf (35):
      storage-daemon: Call job_cancel_sync_all() on shutdown
      stream: Don't crash when node permission is denied
      tests: Drop 'props' from object-add calls
      qapi/qom: Drop deprecated 'props' from object-add
      qapi/qom: Add ObjectOptions for iothread
      qapi/qom: Add ObjectOptions for authz-*
      qapi/qom: Add ObjectOptions for cryptodev-*
      qapi/qom: Add ObjectOptions for dbus-vmstate
      qapi/qom: Add ObjectOptions for memory-backend-*
      qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened'
      qapi/qom: Add ObjectOptions for throttle-group
      qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'
      qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded'
      qapi/qom: Add ObjectOptions for can-*
      qapi/qom: Add ObjectOptions for colo-compare
      qapi/qom: Add ObjectOptions for filter-*
      qapi/qom: Add ObjectOptions for pr-manager-helper
      qapi/qom: Add ObjectOptions for confidential-guest-support
      qapi/qom: Add ObjectOptions for input-*
      qapi/qom: Add ObjectOptions for x-remote-object
      qapi/qom: QAPIfy object-add
      qom: Make "object" QemuOptsList optional
      qemu-storage-daemon: Implement --object with qmp_object_add()
      qom: Remove user_creatable_add_dict()
      qom: Factor out user_creatable_process_cmdline()
      qemu-io: Use user_creatable_process_cmdline() for --object
      qemu-nbd: Use user_creatable_process_cmdline() for --object
      qom: Add user_creatable_add_from_str()
      qemu-img: Use user_creatable_process_cmdline() for --object
      hmp: QAPIfy object_add
      qom: Add user_creatable_parse_str()
      char: Skip CLI aliases in query-chardev-backends
      char: Deprecate backend aliases 'tty' and 'parport'
      char: Simplify chardev_name_foreach()
      qom: Support JSON in HMP object_add and tools --object

Max Reitz (2):
      curl: Store BDRVCURLState pointer in CURLSocket
      curl: Disconnect sockets from CURLState

Stefan Hajnoczi (3):
      block/export: disable VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD for now
      tests/qtest: add multi-queue test case to vhost-user-blk-test
      vhost-user-blk-test: test discard/write zeroes invalid inputs

Stefano Garzarella (1):
      block: remove format defaults from QemuOpts in bdrv_create_file()

 qapi/authz.json                       |  61 ++-
 qapi/block-core.json                  |  27 +
 qapi/common.json                      |  52 ++
 qapi/crypto.json                      | 159 ++++++
 qapi/machine.json                     |  22 +-
 qapi/net.json                         |  20 -
 qapi/qom.json                         | 646 +++++++++++++++++++++-
 qapi/ui.json                          |  13 +-
 docs/system/deprecated.rst            |  31 +-
 docs/system/removed-features.rst      |   5 +
 docs/tools/qemu-img.rst               |   2 +-
 include/qom/object_interfaces.h       |  85 +--
 tests/qtest/libqos/vhost-user-blk.h   |  48 ++
 block.c                               |  36 +-
 block/curl.c                          |  50 +-
 block/export/vhost-user-blk-server.c  |   3 +-
 block/stream.c                        |  15 +-
 chardev/char.c                        |  19 +-
 hw/block/xen-block.c                  |  16 +-
 monitor/hmp-cmds.c                    |  17 +-
 monitor/misc.c                        |   2 -
 qemu-img.c                            | 251 ++-------
 qemu-io.c                             |  33 +-
 qemu-nbd.c                            |  34 +-
 qom/object_interfaces.c               | 119 ++--
 qom/qom-qmp-cmds.c                    |  28 +-
 storage-daemon/qemu-storage-daemon.c  |  28 +-
 tests/qtest/libqos/vhost-user-blk.c   | 130 +++++
 tests/qtest/qmp-cmd-test.c            |  16 +-
 tests/qtest/test-netfilter.c          |  54 +-
 tests/qtest/vhost-user-blk-test.c     | 983 ++++++++++++++++++++++++++++++++++
 tests/unit/test-char.c                |   6 -
 MAINTAINERS                           |   2 +
 hmp-commands.hx                       |   2 +-
 storage-daemon/qapi/qapi-schema.json  |   1 +
 tests/qemu-iotests/tests/qsd-jobs     |  86 +++
 tests/qemu-iotests/tests/qsd-jobs.out |  32 ++
 tests/qtest/libqos/meson.build        |   1 +
 tests/qtest/meson.build               |   4 +
 39 files changed, 2581 insertions(+), 558 deletions(-)
 create mode 100644 tests/qtest/libqos/vhost-user-blk.h
 create mode 100644 tests/qtest/libqos/vhost-user-blk.c
 create mode 100644 tests/qtest/vhost-user-blk-test.c
 create mode 100755 tests/qemu-iotests/tests/qsd-jobs
 create mode 100644 tests/qemu-iotests/tests/qsd-jobs.out

Comments

Peter Maydell March 16, 2021, 1:17 p.m. UTC | #1
On Mon, 15 Mar 2021 at 12:35, Kevin Wolf <kwolf@redhat.com> wrote:
>
> The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:
>
>   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging (2021-03-14 17:47:49 +0000)
>
> are available in the Git repository at:
>
>   git://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to 078ee48ef7d172df1b3ad020255d1eb6beda2daf:
>
>   qom: Support JSON in HMP object_add and tools --object (2021-03-15 13:04:27 +0100)
>
> ----------------------------------------------------------------
> Block layer patches and object-add QAPIfication
>
> - QAPIfy object-add and --object for tools (keyval and JSON support)
> - Add vhost-user-blk-test
> - stream: Fail gracefully if permission is denied
> - storage-daemon: Fix crash on quit when job is still running
> - curl: Fix use after free
> - char: Deprecate backend aliases, fix QMP query-chardev-backends
> - Fix image creation option defaults that exist in both the format and
>   the protocol layer (e.g. 'cluster_size' in qcow2 and rbd; the qcow2
>   default was incorrectly applied to the rbd layer)
>
> ----------------------------------------------------------------

Fails 'make check' on x86-64 linux:

PASS 61 qtest-x86_64/qos-test
/x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/config
PASS 62 qtest-x86_64/qos-test
/x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/basic
PASS 63 qtest-x86_64/qos-test
/x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/resize
**
ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
assertion failed: (!d->bus->get_queue_isr_status(d, vq))
ERROR qtest-x86_64/qos-test - Bail out!
ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
assertion failed: (!d->bus->get_queue_isr_status(d, vq))
Makefile.mtest:1008: recipe for target 'run-test-124' failed
make: *** [run-test-124] Error 1


thanks
-- PMM
Kevin Wolf March 16, 2021, 2:35 p.m. UTC | #2
Am 16.03.2021 um 14:17 hat Peter Maydell geschrieben:
> On Mon, 15 Mar 2021 at 12:35, Kevin Wolf <kwolf@redhat.com> wrote:
> >
> > The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:
> >
> >   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging (2021-03-14 17:47:49 +0000)
> >
> > are available in the Git repository at:
> >
> >   git://repo.or.cz/qemu/kevin.git tags/for-upstream
> >
> > for you to fetch changes up to 078ee48ef7d172df1b3ad020255d1eb6beda2daf:
> >
> >   qom: Support JSON in HMP object_add and tools --object (2021-03-15 13:04:27 +0100)
> >
> > ----------------------------------------------------------------
> > Block layer patches and object-add QAPIfication
> >
> > - QAPIfy object-add and --object for tools (keyval and JSON support)
> > - Add vhost-user-blk-test
> > - stream: Fail gracefully if permission is denied
> > - storage-daemon: Fix crash on quit when job is still running
> > - curl: Fix use after free
> > - char: Deprecate backend aliases, fix QMP query-chardev-backends
> > - Fix image creation option defaults that exist in both the format and
> >   the protocol layer (e.g. 'cluster_size' in qcow2 and rbd; the qcow2
> >   default was incorrectly applied to the rbd layer)
> >
> > ----------------------------------------------------------------
> 
> Fails 'make check' on x86-64 linux:
> 
> PASS 61 qtest-x86_64/qos-test
> /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/config
> PASS 62 qtest-x86_64/qos-test
> /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/basic
> PASS 63 qtest-x86_64/qos-test
> /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/resize
> **
> ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
> assertion failed: (!d->bus->get_queue_isr_status(d, vq))
> ERROR qtest-x86_64/qos-test - Bail out!
> ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
> assertion failed: (!d->bus->get_queue_isr_status(d, vq))
> Makefile.mtest:1008: recipe for target 'run-test-124' failed
> make: *** [run-test-124] Error 1

It didn't fail to me, so the condition must be a little more specific
than just x86_64 Linux.

Stefan, can you have a look? I may have to drop these patches again.

Kevin
Kevin Wolf March 16, 2021, 2:55 p.m. UTC | #3
Am 16.03.2021 um 15:35 hat Kevin Wolf geschrieben:
> Am 16.03.2021 um 14:17 hat Peter Maydell geschrieben:
> > On Mon, 15 Mar 2021 at 12:35, Kevin Wolf <kwolf@redhat.com> wrote:
> > >
> > > The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:
> > >
> > >   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging (2021-03-14 17:47:49 +0000)
> > >
> > > are available in the Git repository at:
> > >
> > >   git://repo.or.cz/qemu/kevin.git tags/for-upstream
> > >
> > > for you to fetch changes up to 078ee48ef7d172df1b3ad020255d1eb6beda2daf:
> > >
> > >   qom: Support JSON in HMP object_add and tools --object (2021-03-15 13:04:27 +0100)
> > >
> > > ----------------------------------------------------------------
> > > Block layer patches and object-add QAPIfication
> > >
> > > - QAPIfy object-add and --object for tools (keyval and JSON support)
> > > - Add vhost-user-blk-test
> > > - stream: Fail gracefully if permission is denied
> > > - storage-daemon: Fix crash on quit when job is still running
> > > - curl: Fix use after free
> > > - char: Deprecate backend aliases, fix QMP query-chardev-backends
> > > - Fix image creation option defaults that exist in both the format and
> > >   the protocol layer (e.g. 'cluster_size' in qcow2 and rbd; the qcow2
> > >   default was incorrectly applied to the rbd layer)
> > >
> > > ----------------------------------------------------------------
> > 
> > Fails 'make check' on x86-64 linux:
> > 
> > PASS 61 qtest-x86_64/qos-test
> > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/config
> > PASS 62 qtest-x86_64/qos-test
> > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/basic
> > PASS 63 qtest-x86_64/qos-test
> > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/resize
> > **
> > ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
> > assertion failed: (!d->bus->get_queue_isr_status(d, vq))
> > ERROR qtest-x86_64/qos-test - Bail out!
> > ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
> > assertion failed: (!d->bus->get_queue_isr_status(d, vq))
> > Makefile.mtest:1008: recipe for target 'run-test-124' failed
> > make: *** [run-test-124] Error 1
> 
> It didn't fail to me, so the condition must be a little more specific
> than just x86_64 Linux.
> 
> Stefan, can you have a look? I may have to drop these patches again.

Actually, these are not the new vhost-user-blk test, but just the normal
virtio-blk ones and it's probably unrelated. This is weird, because this
pull request doesn't include any change to virtio-blk or the related
qtests. Could this be intermittent failure of a change introduced by an
earlier pull request?

Peter, which environment was this and are full logs available? It
doesn't seem to be the Gitlab CI (because the build is still running
there and hasn't failed yet). My first attempts to reproduce have failed
so far.

Kevin
Stefan Hajnoczi March 16, 2021, 3:53 p.m. UTC | #4
On Tue, Mar 16, 2021 at 2:36 PM Kevin Wolf <kwolf@redhat.com> wrote:
>
> Am 16.03.2021 um 14:17 hat Peter Maydell geschrieben:
> > On Mon, 15 Mar 2021 at 12:35, Kevin Wolf <kwolf@redhat.com> wrote:
> > >
> > > The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:
> > >
> > >   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging (2021-03-14 17:47:49 +0000)
> > >
> > > are available in the Git repository at:
> > >
> > >   git://repo.or.cz/qemu/kevin.git tags/for-upstream
> > >
> > > for you to fetch changes up to 078ee48ef7d172df1b3ad020255d1eb6beda2daf:
> > >
> > >   qom: Support JSON in HMP object_add and tools --object (2021-03-15 13:04:27 +0100)
> > >
> > > ----------------------------------------------------------------
> > > Block layer patches and object-add QAPIfication
> > >
> > > - QAPIfy object-add and --object for tools (keyval and JSON support)
> > > - Add vhost-user-blk-test
> > > - stream: Fail gracefully if permission is denied
> > > - storage-daemon: Fix crash on quit when job is still running
> > > - curl: Fix use after free
> > > - char: Deprecate backend aliases, fix QMP query-chardev-backends
> > > - Fix image creation option defaults that exist in both the format and
> > >   the protocol layer (e.g. 'cluster_size' in qcow2 and rbd; the qcow2
> > >   default was incorrectly applied to the rbd layer)
> > >
> > > ----------------------------------------------------------------
> >
> > Fails 'make check' on x86-64 linux:
> >
> > PASS 61 qtest-x86_64/qos-test
> > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/config
> > PASS 62 qtest-x86_64/qos-test
> > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/basic
> > PASS 63 qtest-x86_64/qos-test
> > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/resize
> > **
> > ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
> > assertion failed: (!d->bus->get_queue_isr_status(d, vq))
> > ERROR qtest-x86_64/qos-test - Bail out!
> > ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
> > assertion failed: (!d->bus->get_queue_isr_status(d, vq))
> > Makefile.mtest:1008: recipe for target 'run-test-124' failed
> > make: *** [run-test-124] Error 1
>
> It didn't fail to me, so the condition must be a little more specific
> than just x86_64 Linux.
>
> Stefan, can you have a look? I may have to drop these patches again.

This issue is related to the vhost-user-blk test case and the patches
can be dropped.

Stefan
Stefan Hajnoczi March 16, 2021, 5:16 p.m. UTC | #5
On Tue, Mar 16, 2021 at 03:55:59PM +0100, Kevin Wolf wrote:
> Am 16.03.2021 um 15:35 hat Kevin Wolf geschrieben:
> > Am 16.03.2021 um 14:17 hat Peter Maydell geschrieben:
> > > On Mon, 15 Mar 2021 at 12:35, Kevin Wolf <kwolf@redhat.com> wrote:
> > > >
> > > > The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:
> > > >
> > > >   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging (2021-03-14 17:47:49 +0000)
> > > >
> > > > are available in the Git repository at:
> > > >
> > > >   git://repo.or.cz/qemu/kevin.git tags/for-upstream
> > > >
> > > > for you to fetch changes up to 078ee48ef7d172df1b3ad020255d1eb6beda2daf:
> > > >
> > > >   qom: Support JSON in HMP object_add and tools --object (2021-03-15 13:04:27 +0100)
> > > >
> > > > ----------------------------------------------------------------
> > > > Block layer patches and object-add QAPIfication
> > > >
> > > > - QAPIfy object-add and --object for tools (keyval and JSON support)
> > > > - Add vhost-user-blk-test
> > > > - stream: Fail gracefully if permission is denied
> > > > - storage-daemon: Fix crash on quit when job is still running
> > > > - curl: Fix use after free
> > > > - char: Deprecate backend aliases, fix QMP query-chardev-backends
> > > > - Fix image creation option defaults that exist in both the format and
> > > >   the protocol layer (e.g. 'cluster_size' in qcow2 and rbd; the qcow2
> > > >   default was incorrectly applied to the rbd layer)
> > > >
> > > > ----------------------------------------------------------------
> > > 
> > > Fails 'make check' on x86-64 linux:
> > > 
> > > PASS 61 qtest-x86_64/qos-test
> > > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/config
> > > PASS 62 qtest-x86_64/qos-test
> > > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/basic
> > > PASS 63 qtest-x86_64/qos-test
> > > /x86_64/pc/i440FX-pcihost/pci-bus-pc/pci-bus/virtio-blk-pci/virtio-blk/virtio-blk-tests/resize
> > > **
> > > ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
> > > assertion failed: (!d->bus->get_queue_isr_status(d, vq))
> > > ERROR qtest-x86_64/qos-test - Bail out!
> > > ERROR:../../tests/qtest/libqos/virtio.c:194:qvirtio_wait_status_byte_no_isr:
> > > assertion failed: (!d->bus->get_queue_isr_status(d, vq))
> > > Makefile.mtest:1008: recipe for target 'run-test-124' failed
> > > make: *** [run-test-124] Error 1
> > 
> > It didn't fail to me, so the condition must be a little more specific
> > than just x86_64 Linux.
> > 
> > Stefan, can you have a look? I may have to drop these patches again.
> 
> Actually, these are not the new vhost-user-blk test, but just the normal
> virtio-blk ones and it's probably unrelated. This is weird, because this
> pull request doesn't include any change to virtio-blk or the related
> qtests. Could this be intermittent failure of a change introduced by an
> earlier pull request?
> 
> Peter, which environment was this and are full logs available? It
> doesn't seem to be the Gitlab CI (because the build is still running
> there and hasn't failed yet). My first attempts to reproduce have failed
> so far.

This patch fixes the failure. You can squash it into the
vhost-user-blk-test.c patch or if you've already dropped the patches
then I can send a new revision.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c
index dc9d7a31ae..8796c74ca4 100644
--- a/tests/qtest/vhost-user-blk-test.c
+++ b/tests/qtest/vhost-user-blk-test.c
@@ -580,6 +580,12 @@ static void idx(void *obj, void *u_data, QGuestAllocator *t_alloc)

     qvirtio_set_driver_ok(dev);

+    /*
+     * libvhost-user signals the call fd in VHOST_USER_SET_VRING_CALL, make
+     * sure to wait for the isr here so we don't race and confuse it later on.
+     */
+    qvirtio_wait_queue_isr(qts, dev, vq, QVIRTIO_BLK_TIMEOUT_US);
+
     /* Write request */
     req.type = VIRTIO_BLK_T_OUT;
     req.ioprio = 1;