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