qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 331acd: vhost-user-fs: Back up vqs before cle


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 331acd: vhost-user-fs: Back up vqs before cleaning up vhos...
Date: Thu, 09 Feb 2023 07:29:42 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 331acddc87b739c64b936ba4e58518f8491f1c6b
      
https://github.com/qemu/qemu/commit/331acddc87b739c64b936ba4e58518f8491f1c6b
  Author: Akihiko Odaki <akihiko.odaki@daynix.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M hw/virtio/vhost-user-fs.c

  Log Message:
  -----------
  vhost-user-fs: Back up vqs before cleaning up vhost_dev

vhost_dev_cleanup() clears vhost_dev so back up its vqs member to free
the memory pointed by the member.

Fixes: 98fc1ada4c ("virtio: add vhost-user-fs base device")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230130140225.77964-1-akihiko.odaki@daynix.com>


  Commit: 1f433e84c3f3ddda90ba235e65b99ef1112f48c7
      
https://github.com/qemu/qemu/commit/1f433e84c3f3ddda90ba235e65b99ef1112f48c7
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: add missing AioContext lock

virtio_blk_update_config() calls blk_get_geometry and blk_getlength,
and both functions eventually end up calling bdrv_poll_co when not
running in a coroutine:
- blk_getlength is a co_wrapper_mixed function
- blk_get_geometry calls bdrv_get_geometry -> bdrv_nb_sectors, a
  co_wrapper_mixed function too

Since we are not running in a coroutine, we need to take s->blk
AioContext lock, otherwise bdrv_poll_co will inevitably call
AIO_WAIT_WHILE and therefore try to un unlock() an AioContext lock
that was never acquired.

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2167838

Steps to reproduce the issue: simply boot a VM with
-object '{"qom-type":"iothread","id":"iothread1"}' \
-blockdev 
'{"driver":"file","filename":"$QCOW2","aio":"native","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}'
 \
-blockdev 
'{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}'
 \
-device 
virtio-blk-pci,iothread=iothread1,drive=libvirt-1-format,id=virtio-disk0,bootindex=1,write-cache=on

and observe that it will fail not manage to boot with "qemu_mutex_unlock_impl: 
Operation not permitted"

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Lukáš Doktor <ldoktor@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230208111148.1040083-1-eesposit@redhat.com>


  Commit: 3c5867156eb81c7c71611d078b2c5c2c863f884a
      
https://github.com/qemu/qemu/commit/3c5867156eb81c7c71611d078b2c5c2c863f884a
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: fix detect-zeroes= with BDRV_REQ_REGISTERED_BUF

When a write request is converted into a write zeroes request by the
detect-zeroes= feature, it is no longer associated with an I/O buffer.
The BDRV_REQ_REGISTERED_BUF flag doesn't make sense without an I/O
buffer and must be cleared because bdrv_co_do_pwrite_zeroes() fails with
-EINVAL when it's set.

Fiona Ebner <f.ebner@proxmox.com> bisected and diagnosed this QEMU 7.2
regression where writes containing zeroes to a blockdev with
discard=unmap,detect-zeroes=unmap fail.

Buglink: https://gitlab.com/qemu-project/qemu/-/issues/1404
Fixes: e8b6535533be ("block: add BDRV_REQ_REGISTERED_BUF request flag")
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230207203719.242926-2-stefanha@redhat.com>


  Commit: 1321e00801bc26ff8059e8513f3ae3f7265d24f6
      
https://github.com/qemu/qemu/commit/1321e00801bc26ff8059e8513f3ae3f7265d24f6
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M qemu-io-cmds.c

  Log Message:
  -----------
  qemu-io: use BdrvRequestFlags instead of int

The block layer APIs use BdrvRequestFlags while qemu-io code uses int.
Although the code compiles and runs fine, BdrvRequestFlags is clearer
because it differentiates between other types of flags like bdrv_open()
flags.

This is purely refactoring.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230207203719.242926-3-stefanha@redhat.com>


  Commit: 00e2a04c274cacfc2134e7b88f120ebe762f7223
      
https://github.com/qemu/qemu/commit/00e2a04c274cacfc2134e7b88f120ebe762f7223
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M qemu-io-cmds.c

  Log Message:
  -----------
  qemu-io: add -r option to register I/O buffer

The blk_register_buf() API is an optimization hint that allows some
block drivers to avoid I/O buffer housekeeping or bounce buffers.

Add an -r option to register the I/O buffer so that qemu-io can be used
to test the blk_register_buf() API. The next commit will add a test that
uses the new option.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230207203719.242926-4-stefanha@redhat.com>


  Commit: acbc8aee5b09222dc6a5cb88306b67bcbe37e30b
      
https://github.com/qemu/qemu/commit/acbc8aee5b09222dc6a5cb88306b67bcbe37e30b
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    A tests/qemu-iotests/tests/detect-zeroes-registered-buf
    A tests/qemu-iotests/tests/detect-zeroes-registered-buf.out

  Log Message:
  -----------
  iotests/detect-zeroes-registered-buf: add new test

This regression test demonstrates that detect-zeroes works with
registered buffers. Bug details:
https://gitlab.com/qemu-project/qemu/-/issues/1404

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230207203719.242926-5-stefanha@redhat.com>


  Commit: 3b33ae48ec28e1e0d1bc28a85c7423724bcb1a2c
      
https://github.com/qemu/qemu/commit/3b33ae48ec28e1e0d1bc28a85c7423724bcb1a2c
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M block/io.c
    M hw/block/virtio-blk.c
    M hw/virtio/vhost-user-fs.c
    M qemu-io-cmds.c
    A tests/qemu-iotests/tests/detect-zeroes-registered-buf
    A tests/qemu-iotests/tests/detect-zeroes-registered-buf.out

  Log Message:
  -----------
  Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into 
staging

Pull request

A few fixes that I've picked up.

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmPlEFsACgkQnKSrs4Gr
# c8h3OggAj5TeIB/R6F69vHIuoqogJELm5jVkPoXd1VK+nAayEXHFmEfUi72JIh62
# l8E4NOuUIxwSXdD2HLH/CpezBh5EVW/LJ9AfRUXCWV65KL92dkZoQyxonNQMKdQ3
# pxj7zwHrlsdORPfRSnFVaGksaIdePgj46CjSQh8IF8RMvYMVF9hG3ias7rT+EWi7
# SidPse4tik3WPxWteEXQd/8fdUehloPOB6Xm8pFilr0oR/TlRyMRWeaUs5+6WUIy
# y1+mqObsY22DvIDqsqTbZDULnHXAI5zxy9gwHi+DhRi3DbuAxdjH1Vclk0Y9wsGY
# QKhoFtGhfOd+94uSusp5UbG5iNvbuQ==
# =HZZr
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 09 Feb 2023 15:25:15 GMT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
  iotests/detect-zeroes-registered-buf: add new test
  qemu-io: add -r option to register I/O buffer
  qemu-io: use BdrvRequestFlags instead of int
  block: fix detect-zeroes= with BDRV_REQ_REGISTERED_BUF
  virtio-blk: add missing AioContext lock
  vhost-user-fs: Back up vqs before cleaning up vhost_dev

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/7a332492724a...3b33ae48ec28



reply via email to

[Prev in Thread] Current Thread [Next in Thread]