qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] blockdev: avoid acquiring AioContext lock twice at do_drive_backup()
@ 2019-09-13 15:25 Sergio Lopez
  2019-09-13 15:25 ` [Qemu-devel] [PATCH v2 1/2] blockdev: release the AioContext at drive_backup_prepare Sergio Lopez
  2019-09-13 15:25 ` [Qemu-devel] [PATCH v2 2/2] blockdev: honor bdrv_try_set_aio_context() context requirements Sergio Lopez
  0 siblings, 2 replies; 9+ messages in thread
From: Sergio Lopez @ 2019-09-13 15:25 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, armbru, qemu-devel, Sergio Lopez, mreitz

do_drive_backup() acquires the AioContext lock of the corresponding
BlockDriverState. This is not a problem when it's called from
qmp_drive_backup(), but drive_backup_prepare() also acquires the lock
before calling it.

Additionally, Max Reitz pointed out that bdrv_try_set_aio_context() is
called at do_backup_common() with the new context held, and the old
context not held, while it expects it to be the other way
around. This is also the case for other uses of that function on
blockdev.c.

This patch series fixes all occurrences of bdrv_try_set_aio_context()
to honor the context requirements. It also changes
drive_backup_prepare() to release the context before calling
do_drive_backup().

---
Changelog

v2:
 - Honor bdrv_try_set_aio_context() context acquisition requirements
   (thanks Max Reitz).
 - Release the context at drive_backup_prepare() instead of avoiding
   re-acquiring it at do_drive_baclup(). (thanks Max Reitz)
 - Convert a single patch into a two-patch series.
---

Sergio Lopez (2):
  blockdev: release the AioContext at drive_backup_prepare
  blockdev: honor bdrv_try_set_aio_context() context requirements

 blockdev.c | 127 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 76 insertions(+), 51 deletions(-)

-- 
2.21.0



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

end of thread, other threads:[~2019-10-10 15:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 15:25 [Qemu-devel] [PATCH v2 0/2] blockdev: avoid acquiring AioContext lock twice at do_drive_backup() Sergio Lopez
2019-09-13 15:25 ` [Qemu-devel] [PATCH v2 1/2] blockdev: release the AioContext at drive_backup_prepare Sergio Lopez
2019-09-13 19:54   ` [Qemu-devel] [Qemu-block] " John Snow
2019-09-16  7:53     ` Kevin Wolf
2019-09-16 11:17       ` Sergio Lopez
2019-10-03  9:33         ` Sergio Lopez
2019-10-10 15:02           ` Kevin Wolf
2019-09-16 11:17     ` [Qemu-devel] " Sergio Lopez
2019-09-13 15:25 ` [Qemu-devel] [PATCH v2 2/2] blockdev: honor bdrv_try_set_aio_context() context requirements Sergio Lopez

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).