mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
e3796a245a
commit
f4d9cc88ee
2 changed files with 30 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue