summaryrefslogtreecommitdiffstats
path: root/include/sysemu
diff options
context:
space:
mode:
authorJohn Snow2017-03-16 22:23:50 +0100
committerJeff Cody2017-03-22 18:26:27 +0100
commitf4d9cc88ee69a5b04a843424e50f466e36fcad4e (patch)
treea2d8777a5e230efd54adfadd6020f8a1ab77e5b8 /include/sysemu
parentblockjob: add block_job_start_shim (diff)
downloadqemu-f4d9cc88ee69a5b04a843424e50f466e36fcad4e.tar.gz
qemu-f4d9cc88ee69a5b04a843424e50f466e36fcad4e.tar.xz
qemu-f4d9cc88ee69a5b04a843424e50f466e36fcad4e.zip
block-backend: add drained_begin / drained_end ops
Allow block backends to forward drain requests to their devices/users. The initial intended purpose for this patch is to allow BBs to forward requests along to BlockJobs, which will want to pause if their associated BB has entered a drained region. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 20170316212351.13797-3-jsnow@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'include/sysemu')
-rw-r--r--include/sysemu/block-backend.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 096c17fce0..7462228ac1 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -58,6 +58,14 @@ typedef struct BlockDevOps {
* Runs when the size changed (e.g. monitor command block_resize)
*/
void (*resize_cb)(void *opaque);
+ /*
+ * Runs when the backend receives a drain request.
+ */
+ void (*drained_begin)(void *opaque);
+ /*
+ * Runs when the backend's last drain request ends.
+ */
+ void (*drained_end)(void *opaque);
} BlockDevOps;
/* This struct is embedded in (the private) BlockBackend struct and contains