monitor/qmp: Update comment for commit 4eaca8de268
[qemu/armbru.git] / include / scsi / pr-manager.h
blob6ad5fd1ff7d57fd0d046c3cac8d11a2ca9933600
1 #ifndef PR_MANAGER_H
2 #define PR_MANAGER_H
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"
10 #define TYPE_PR_MANAGER "pr-manager"
12 #define PR_MANAGER_CLASS(klass) \
13 OBJECT_CLASS_CHECK(PRManagerClass, (klass), TYPE_PR_MANAGER)
14 #define PR_MANAGER_GET_CLASS(obj) \
15 OBJECT_GET_CLASS(PRManagerClass, (obj), TYPE_PR_MANAGER)
16 #define PR_MANAGER(obj) \
17 OBJECT_CHECK(PRManager, (obj), TYPE_PR_MANAGER)
19 struct sg_io_hdr;
21 typedef struct PRManager {
22 /* <private> */
23 Object parent;
24 } PRManager;
26 /**
27 * PRManagerClass:
28 * @parent_class: the base class
29 * @run: callback invoked in thread pool context
31 typedef struct PRManagerClass {
32 /* <private> */
33 ObjectClass parent_class;
35 /* <public> */
36 int (*run)(PRManager *pr_mgr, int fd, struct sg_io_hdr *hdr);
37 bool (*is_connected)(PRManager *pr_mgr);
38 } PRManagerClass;
40 bool pr_manager_is_connected(PRManager *pr_mgr);
41 int coroutine_fn pr_manager_execute(PRManager *pr_mgr, AioContext *ctx, int fd,
42 struct sg_io_hdr *hdr);
44 PRManager *pr_manager_lookup(const char *id, Error **errp);
46 #endif