summary refs log tree commit diff stats
path: root/scripts/qapi/schema.py
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2023-03-09 14:08:52 -0500
committerKevin Wolf <kwolf@redhat.com>2023-04-25 13:17:28 +0200
commitd805d8a2c70d73fc5a1f29b70296e74a012e865b (patch)
tree721ff4d2901bdbacec30ab50e2d0355eae94ec8d /scripts/qapi/schema.py
parente5568a6603073884fb66e71bd133f082de763af9 (diff)
downloadfocaccia-qemu-d805d8a2c70d73fc5a1f29b70296e74a012e865b.tar.gz
focaccia-qemu-d805d8a2c70d73fc5a1f29b70296e74a012e865b.zip
block: convert bdrv_graph_wrlock() to AIO_WAIT_WHILE_UNLOCKED()
The following conversion is safe and does not change behavior:

     GLOBAL_STATE_CODE();
     ...
  -  AIO_WAIT_WHILE(qemu_get_aio_context(), ...);
  +  AIO_WAIT_WHILE_UNLOCKED(NULL, ...);

Since we're in GLOBAL_STATE_CODE(), qemu_get_aio_context() is our home
thread's AioContext. Thus AIO_WAIT_WHILE() does not unlock the
AioContext:

  if (ctx_ && in_aio_context_home_thread(ctx_)) {                \
      while ((cond)) {                                           \
          aio_poll(ctx_, true);                                  \
          waited_ = true;                                        \
      }                                                          \

And that means AIO_WAIT_WHILE_UNLOCKED(NULL, ...) can be substituted.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230309190855.414275-4-stefanha@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'scripts/qapi/schema.py')
0 files changed, 0 insertions, 0 deletions