From: Sergio Lopez <slp@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Sergio Lopez <slp@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PATCH v4 0/5] blockdev: avoid acquiring AioContext lock twice at do_drive_backup and do_blockdev_backup
Date: Thu, 21 Nov 2019 14:57:54 +0100 [thread overview]
Message-ID: <20191121135759.101655-1-slp@redhat.com> (raw)
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. The same things happens with do_blockdev_backup()
and blockdev_backup_prepare().
This patch series merges do_drive_backup() with drive_backup_prepare()
and do_blockdev_backup() with blockdev_backup_prepare(), and ensures
they're only getting called from a transaction context. This way,
there's a single code path for both transaction requests and qmp
commands, as suggested by Kevin Wolf.
We also take this opportunity to ensure we're honoring the context
acquisition semantics required by bdrv_try_set_aio_context, as
suggested by Max Reitz.
---
Changelog:
v4:
- Unify patches 1-4 and 5-7 to avoid producing broken interim
states. (thanks Max Reitz)
- Include a fix for iotest 141. (thanks Kevin Wolf)
v3:
- Rework the whole patch series to fix the issue by consolidating all
operations in the transaction model. (thanks Kevin Wolf)
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 (5):
blockdev: fix coding style issues in drive_backup_prepare
blockdev: unify qmp_drive_backup and drive-backup transaction paths
blockdev: unify qmp_blockdev_backup and blockdev-backup transaction
paths
blockdev: honor bdrv_try_set_aio_context() context requirements
iotests: fix 141 after qmp_drive_backup with transactions
blockdev.c | 349 ++++++++++++++++++-------------------
tests/qemu-iotests/141.out | 2 +
2 files changed, 173 insertions(+), 178 deletions(-)
--
2.23.0
next reply other threads:[~2019-11-21 13:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 13:57 Sergio Lopez [this message]
2019-11-21 13:57 ` [PATCH v4 1/5] blockdev: fix coding style issues in drive_backup_prepare Sergio Lopez
2019-11-27 15:53 ` Max Reitz
2019-11-21 13:57 ` [PATCH v4 2/5] blockdev: unify qmp_drive_backup and drive-backup transaction paths Sergio Lopez
2019-11-27 16:37 ` Max Reitz
2019-11-21 13:57 ` [PATCH v4 3/5] blockdev: unify qmp_blockdev_backup and blockdev-backup " Sergio Lopez
2019-11-27 16:49 ` Max Reitz
2019-11-21 13:57 ` [PATCH v4 4/5] blockdev: honor bdrv_try_set_aio_context() context requirements Sergio Lopez
2019-11-27 17:10 ` Max Reitz
2019-11-21 13:57 ` [PATCH v4 5/5] iotests: fix 141 after qmp_drive_backup with transactions Sergio Lopez
2019-11-27 16:19 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191121135759.101655-1-slp@redhat.com \
--to=slp@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).