diff options
| author | John Snow <jsnow@redhat.com> | 2017-03-16 17:23:50 -0400 |
|---|---|---|
| committer | Jeff Cody <jcody@redhat.com> | 2017-03-22 13:26:27 -0400 |
| commit | f4d9cc88ee69a5b04a843424e50f466e36fcad4e (patch) | |
| tree | a2d8777a5e230efd54adfadd6020f8a1ab77e5b8 /include | |
| parent | e3796a245ad0efa65ca8d2dc6424562a8fbaeb6a (diff) | |
| download | focaccia-qemu-f4d9cc88ee69a5b04a843424e50f466e36fcad4e.tar.gz focaccia-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')
| -rw-r--r-- | include/sysemu/block-backend.h | 8 |
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 |