4 #include "qom/object.h"
5 #include "qapi/visitor.h"
6 #include "qom/object_interfaces.h"
9 #define TYPE_PR_MANAGER "pr-manager"
11 #define PR_MANAGER_CLASS(klass) \
12 OBJECT_CLASS_CHECK(PRManagerClass, (klass), TYPE_PR_MANAGER)
13 #define PR_MANAGER_GET_CLASS(obj) \
14 OBJECT_GET_CLASS(PRManagerClass, (obj), TYPE_PR_MANAGER)
15 #define PR_MANAGER(obj) \
16 OBJECT_CHECK(PRManager, (obj), TYPE_PR_MANAGER)
20 typedef struct PRManager
{
27 * @parent_class: the base class
28 * @run: callback invoked in thread pool context
30 typedef struct PRManagerClass
{
32 ObjectClass parent_class
;
35 int (*run
)(PRManager
*pr_mgr
, int fd
, struct sg_io_hdr
*hdr
);
36 bool (*is_connected
)(PRManager
*pr_mgr
);
39 bool pr_manager_is_connected(PRManager
*pr_mgr
);
40 BlockAIOCB
*pr_manager_execute(PRManager
*pr_mgr
,
41 AioContext
*ctx
, int fd
,
42 struct sg_io_hdr
*hdr
,
43 BlockCompletionFunc
*complete
,
46 PRManager
*pr_manager_lookup(const char *id
, Error
**errp
);