aboutsummaryrefslogtreecommitdiff
path: root/include/block/block_int.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2015-04-08 13:43:47 +0200
committerKevin Wolf <kwolf@redhat.com>2015-06-12 17:04:59 +0200
commitf3930ed0bb1945b59da8e591072b5c79606d0760 (patch)
treebbc19fff220e6e2291622b755259549adf733a17 /include/block/block_int.h
parent18edf289a8951f3a48caff3b5fe17f2d414c2924 (diff)
block: Move flag inheritance to bdrv_open_inherit()
Instead of letting every caller of bdrv_open() determine the right flags for its child node manually and pass them to the function, pass the parent node and the role of the newly opened child (like backing file, protocol layer, etc.). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/block/block_int.h')
-rw-r--r--include/block/block_int.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index f004378d58..662dd56afe 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -330,6 +330,13 @@ typedef struct BdrvAioNotifier {
QLIST_ENTRY(BdrvAioNotifier) list;
} BdrvAioNotifier;
+struct BdrvChildRole {
+ int (*inherit_flags)(int parent_flags);
+};
+
+extern const BdrvChildRole child_file;
+extern const BdrvChildRole child_format;
+
/*
* Note: the function bdrv_append() copies and swaps contents of
* BlockDriverStates, so if you add new fields to this struct, please