4 #include "qom/object.h"
5 #include "qapi/visitor.h"
6 #include "qom/object_interfaces.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)
21 typedef struct PRManager
{
28 * @parent_class: the base class
29 * @run: callback invoked in thread pool context
31 typedef struct PRManagerClass
{
33 ObjectClass parent_class
;
36 int (*run
)(PRManager
*pr_mgr
, int fd
, struct sg_io_hdr
*hdr
);
37 bool (*is_connected
)(PRManager
*pr_mgr
);
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
);