2020-06-25 14:55:48 +02:00
|
|
|
|
|
|
|
{"return": {}}
|
|
|
|
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
|
|
|
|
{"return": {}}
|
crypto: perform permission checks under BQL
Move the permission API calls into driver-specific callbacks
that always run under BQL. In this case, bdrv_crypto_luks
needs to perform permission checks before and after
qcrypto_block_amend_options(). The problem is that the caller,
block_crypto_amend_options_generic_luks(), can also run in I/O
from .bdrv_co_amend(). This does not comply with Global State-I/O API split,
as permissions API must always run under BQL.
Firstly, introduce .bdrv_amend_pre_run() and .bdrv_amend_clean()
callbacks. These two callbacks are guaranteed to be invoked under
BQL, respectively before and after .bdrv_co_amend().
They take care of performing the permission checks
in the same way as they are currently done before and after
qcrypto_block_amend_options().
These callbacks are in preparation for next patch, where we
delete the original permission check. Right now they just add redundant
control.
Then, call .bdrv_amend_pre_run() before job_start in
qmp_x_blockdev_amend(), so that it will be run before the job coroutine
is created and stay in the main loop.
As a cleanup, use JobDriver's .clean() callback to call
.bdrv_amend_clean(), and run amend-specific cleanup callbacks under BQL.
After this patch, permission failures occur early in the blockdev-amend
job to update a LUKS volume's keys. iotest 296 must now expect them in
x-blockdev-amend's QMP reply instead of waiting for the actual job to
fail later.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220209105452.1694545-2-eesposit@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220304153729.711387-6-hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2022-02-09 11:54:48 +01:00
|
|
|
{"error": {"class": "GenericError", "desc": "Failed to get shared \"consistent read\" lock"}}
|
|
|
|
{"error": {"class": "GenericError", "desc": "Failed to get shared \"consistent read\" lock"}}
|
2020-06-25 14:55:48 +02:00
|
|
|
{"return": {}}
|
|
|
|
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
|
|
|
|
{"return": {}}
|
|
|
|
qemu-img: Failed to get shared "consistent read" lock
|
|
|
|
Is another process using the image [TEST_DIR/test.img]?
|
|
|
|
|
2021-12-23 17:01:34 +01:00
|
|
|
.
|
crypto: perform permission checks under BQL
Move the permission API calls into driver-specific callbacks
that always run under BQL. In this case, bdrv_crypto_luks
needs to perform permission checks before and after
qcrypto_block_amend_options(). The problem is that the caller,
block_crypto_amend_options_generic_luks(), can also run in I/O
from .bdrv_co_amend(). This does not comply with Global State-I/O API split,
as permissions API must always run under BQL.
Firstly, introduce .bdrv_amend_pre_run() and .bdrv_amend_clean()
callbacks. These two callbacks are guaranteed to be invoked under
BQL, respectively before and after .bdrv_co_amend().
They take care of performing the permission checks
in the same way as they are currently done before and after
qcrypto_block_amend_options().
These callbacks are in preparation for next patch, where we
delete the original permission check. Right now they just add redundant
control.
Then, call .bdrv_amend_pre_run() before job_start in
qmp_x_blockdev_amend(), so that it will be run before the job coroutine
is created and stay in the main loop.
As a cleanup, use JobDriver's .clean() callback to call
.bdrv_amend_clean(), and run amend-specific cleanup callbacks under BQL.
After this patch, permission failures occur early in the blockdev-amend
job to update a LUKS volume's keys. iotest 296 must now expect them in
x-blockdev-amend's QMP reply instead of waiting for the actual job to
fail later.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220209105452.1694545-2-eesposit@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220304153729.711387-6-hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2022-02-09 11:54:48 +01:00
|
|
|
{"error": {"class": "GenericError", "desc": "Block node is read-only"}}
|
|
|
|
{"error": {"class": "GenericError", "desc": "Failed to get shared \"consistent read\" lock"}}
|
|
|
|
{"error": {"class": "GenericError", "desc": "Failed to get shared \"consistent read\" lock"}}
|
2020-06-25 14:55:48 +02:00
|
|
|
{"return": {}}
|
|
|
|
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
|
|
|
|
{"return": {}}
|
2021-12-23 17:01:34 +01:00
|
|
|
.
|
2020-07-19 14:20:59 +02:00
|
|
|
{"return": {}}
|
|
|
|
{"error": {"class": "GenericError", "desc": "Failed to get \"write\" lock"}}
|
2021-12-23 17:01:34 +01:00
|
|
|
.
|
2020-07-19 14:20:59 +02:00
|
|
|
{"return": {}}
|
|
|
|
{"return": {}}
|
2021-05-03 13:01:06 +02:00
|
|
|
.
|
2020-06-25 14:55:48 +02:00
|
|
|
----------------------------------------------------------------------
|
2020-07-19 14:20:59 +02:00
|
|
|
Ran 4 tests
|
2020-06-25 14:55:48 +02:00
|
|
|
|
|
|
|
OK
|