All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [PULL 36/50] block/copy-before-write.h: global state API + assertions
Date: Fri,  4 Mar 2022 17:46:57 +0100	[thread overview]
Message-ID: <20220304164711.474713-37-kwolf@redhat.com> (raw)
In-Reply-To: <20220304164711.474713-1-kwolf@redhat.com>

From: Emanuele Giuseppe Esposito <eesposit@redhat.com>

copy-before-write functions always run under BQL.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220303151616.325444-24-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/copy-before-write.h | 7 +++++++
 block/copy-before-write.c | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/block/copy-before-write.h b/block/copy-before-write.h
index 51847e711a..6e72bb25e9 100644
--- a/block/copy-before-write.h
+++ b/block/copy-before-write.h
@@ -29,6 +29,13 @@
 #include "block/block_int.h"
 #include "block/block-copy.h"
 
+/*
+ * Global state (GS) API. These functions run under the BQL.
+ *
+ * See include/block/block-global-state.h for more information about
+ * the GS API.
+ */
+
 BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
                                   BlockDriverState *target,
                                   const char *filter_node_name,
diff --git a/block/copy-before-write.c b/block/copy-before-write.c
index c30a5ff8de..80b7684dba 100644
--- a/block/copy-before-write.c
+++ b/block/copy-before-write.c
@@ -223,6 +223,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
     QDict *opts;
 
     assert(source->total_sectors == target->total_sectors);
+    GLOBAL_STATE_CODE();
 
     opts = qdict_new();
     qdict_put_str(opts, "driver", "copy-before-write");
@@ -245,6 +246,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
 
 void bdrv_cbw_drop(BlockDriverState *bs)
 {
+    GLOBAL_STATE_CODE();
     bdrv_drop_filter(bs, &error_abort);
     bdrv_unref(bs);
 }
-- 
2.35.1



  parent reply	other threads:[~2022-03-04 17:07 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 16:46 [PULL 00/50] Block layer patches Kevin Wolf
2022-03-04 16:46 ` [PULL 01/50] crypto: perform permission checks under BQL Kevin Wolf
2022-03-04 16:46 ` [PULL 02/50] crypto: distinguish between main loop and I/O in block_crypto_amend_options_generic_luks Kevin Wolf
2022-03-04 16:46 ` [PULL 03/50] block: introduce bdrv_activate Kevin Wolf
2022-03-04 16:46 ` [PULL 04/50] block: rename bdrv_invalidate_cache_all, blk_invalidate_cache and test_sync_op_invalidate_cache Kevin Wolf
2022-03-04 16:46 ` [PULL 05/50] block: move BQL logic of bdrv_co_invalidate_cache in bdrv_activate Kevin Wolf
2022-03-04 16:46 ` [PULL 06/50] tls: add macros for coroutine-safe TLS variables Kevin Wolf
2022-03-04 16:46 ` [PULL 07/50] util/async: replace __thread with QEMU TLS macros Kevin Wolf
2022-03-04 16:46 ` [PULL 08/50] rcu: use coroutine " Kevin Wolf
2022-03-04 16:46 ` [PULL 09/50] cpus: use coroutine TLS macros for iothread_locked Kevin Wolf
2022-03-04 16:46 ` [PULL 10/50] os-posix: Add os_set_daemonize() Kevin Wolf
2022-03-04 16:46 ` [PULL 11/50] qsd: Add pre-init argument parsing pass Kevin Wolf
2022-03-04 16:46 ` [PULL 12/50] qsd: Add --daemonize Kevin Wolf
2022-03-04 16:46 ` [PULL 13/50] iotests/185: Add post-READY quit tests Kevin Wolf
2022-03-04 16:46 ` [PULL 14/50] main-loop.h: introduce qemu_in_main_thread() Kevin Wolf
2022-03-04 16:46 ` [PULL 15/50] main loop: macros to mark GS and I/O functions Kevin Wolf
2022-03-04 16:46 ` [PULL 16/50] include/block/block: split header into I/O and global state API Kevin Wolf
2022-03-04 16:46 ` [PULL 17/50] assertions for block " Kevin Wolf
2022-03-04 16:46 ` [PULL 18/50] IO_CODE and IO_OR_GS_CODE for block I/O API Kevin Wolf
2022-03-04 16:46 ` [PULL 19/50] block/export/fuse.c: allow writable exports to take RESIZE permission Kevin Wolf
2022-03-04 16:46 ` [PULL 20/50] include/sysemu/block-backend: split header into I/O and global state (GS) API Kevin Wolf
2022-03-04 16:46 ` [PULL 21/50] block/block-backend.c: assertions for block-backend Kevin Wolf
2022-03-16 12:44   ` Philippe Mathieu-Daudé
2022-03-16 12:53     ` Philippe Mathieu-Daudé
2022-03-16 14:46       ` Emanuele Giuseppe Esposito
2022-03-16 15:25         ` Philippe Mathieu-Daudé
2022-03-16 16:02           ` Kevin Wolf
2022-03-16 12:54     ` Emanuele Giuseppe Esposito
2022-03-04 16:46 ` [PULL 22/50] IO_CODE and IO_OR_GS_CODE for block-backend I/O API Kevin Wolf
2022-03-04 16:46 ` [PULL 23/50] block.c: assertions to the block layer permissions API Kevin Wolf
2022-03-04 16:46 ` [PULL 24/50] include/block/block_int: split header into I/O and global state API Kevin Wolf
2022-03-04 16:46 ` [PULL 25/50] assertions for block_int " Kevin Wolf
2022-03-04 16:46 ` [PULL 26/50] IO_CODE and IO_OR_GS_CODE for block_int I/O API Kevin Wolf
2022-03-04 16:46 ` [PULL 27/50] block: introduce assert_bdrv_graph_writable Kevin Wolf
2022-03-04 16:46 ` [PULL 28/50] include/block/blockjob_int.h: split header into I/O and GS API Kevin Wolf
2022-03-04 16:46 ` [PULL 29/50] GS and IO CODE macros for blockjob_int.h Kevin Wolf
2022-03-04 16:46 ` [PULL 30/50] block.c: add assertions to static functions Kevin Wolf
2022-03-04 16:46 ` [PULL 31/50] include/block/blockjob.h: global state API Kevin Wolf
2022-03-04 16:46 ` [PULL 32/50] assertions for blockjob.h " Kevin Wolf
2022-03-04 16:46 ` [PULL 33/50] include/sysemu/blockdev.h: " Kevin Wolf
2022-03-04 16:46 ` [PULL 34/50] assertions for blockdev.h " Kevin Wolf
2022-03-04 16:46 ` [PULL 35/50] include/block/snapshot: global state API + assertions Kevin Wolf
2022-03-04 16:46 ` Kevin Wolf [this message]
2022-03-04 16:46 ` [PULL 37/50] block/coroutines: I/O and "I/O or GS" API Kevin Wolf
2022-03-04 16:46 ` [PULL 38/50] block_int-common.h: split function pointers in BlockDriver Kevin Wolf
2022-03-04 16:47 ` [PULL 39/50] block_int-common.h: assertions in the callers of BlockDriver function pointers Kevin Wolf
2022-03-04 16:47 ` [PULL 40/50] block_int-common.h: split function pointers in BdrvChildClass Kevin Wolf
2022-03-04 16:47 ` [PULL 41/50] block_int-common.h: assertions in the callers of BdrvChildClass function pointers Kevin Wolf
2022-03-04 16:47 ` [PULL 42/50] block-backend-common.h: split function pointers in BlockDevOps Kevin Wolf
2022-03-04 16:47 ` [PULL 43/50] job.h: split function pointers in JobDriver Kevin Wolf
2022-03-04 16:47 ` [PULL 44/50] job.h: assertions in the callers of JobDriver function pointers Kevin Wolf
2022-03-04 16:47 ` [PULL 45/50] block: Make bdrv_refresh_limits() non-recursive Kevin Wolf
2022-03-04 16:47 ` [PULL 46/50] iotests: Allow using QMP with the QSD Kevin Wolf
2022-03-04 16:47 ` [PULL 47/50] iotests/graph-changes-while-io: New test Kevin Wolf
2022-03-04 16:47 ` [PULL 48/50] tests/qemu-iotests: Rework the checks and spots using GNU sed Kevin Wolf
2022-03-04 16:47 ` [PULL 49/50] block/amend: Always call .bdrv_amend_clean() Kevin Wolf
2022-03-04 16:47 ` [PULL 50/50] block/amend: Keep strong reference to BDS Kevin Wolf
2022-03-05 14:43 ` [PULL 00/50] Block layer patches Peter Maydell

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=20220304164711.474713-37-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.