]>
Commit | Line | Data |
---|---|---|
7c9e5276 PB |
1 | #ifndef PR_MANAGER_H |
2 | #define PR_MANAGER_H | |
3 | ||
4 | #include "qom/object.h" | |
7c9e5276 PB |
5 | #include "qapi/visitor.h" |
6 | #include "qom/object_interfaces.h" | |
7 | #include "block/aio.h" | |
2f3a7ab3 | 8 | #include "qemu/coroutine.h" |
7c9e5276 PB |
9 | |
10 | #define TYPE_PR_MANAGER "pr-manager" | |
11 | ||
c821774a | 12 | OBJECT_DECLARE_TYPE(PRManager, PRManagerClass, |
30b5707c | 13 | PR_MANAGER) |
7c9e5276 PB |
14 | |
15 | struct sg_io_hdr; | |
16 | ||
db1015e9 | 17 | struct PRManager { |
7c9e5276 PB |
18 | /* <private> */ |
19 | Object parent; | |
db1015e9 | 20 | }; |
7c9e5276 PB |
21 | |
22 | /** | |
23 | * PRManagerClass: | |
24 | * @parent_class: the base class | |
25 | * @run: callback invoked in thread pool context | |
26 | */ | |
db1015e9 | 27 | struct PRManagerClass { |
7c9e5276 PB |
28 | /* <private> */ |
29 | ObjectClass parent_class; | |
30 | ||
31 | /* <public> */ | |
32 | int (*run)(PRManager *pr_mgr, int fd, struct sg_io_hdr *hdr); | |
5f640894 | 33 | bool (*is_connected)(PRManager *pr_mgr); |
db1015e9 | 34 | }; |
7c9e5276 | 35 | |
5f640894 | 36 | bool pr_manager_is_connected(PRManager *pr_mgr); |
2f3a7ab3 KW |
37 | int coroutine_fn pr_manager_execute(PRManager *pr_mgr, AioContext *ctx, int fd, |
38 | struct sg_io_hdr *hdr); | |
7c9e5276 | 39 | |
7c9e5276 | 40 | PRManager *pr_manager_lookup(const char *id, Error **errp); |
7c9e5276 PB |
41 | |
42 | #endif |