From f4d9cc88ee69a5b04a843424e50f466e36fcad4e Mon Sep 17 00:00:00 2001 From: John Snow Date: Thu, 16 Mar 2017 17:23:50 -0400 Subject: 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 Reviewed-by: Jeff Cody Message-id: 20170316212351.13797-3-jsnow@redhat.com Signed-off-by: Jeff Cody --- include/sysemu/block-backend.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') 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 -- cgit v1.2.1