ui: fix virtual timers
[qemu/ar7.git] / include / scsi / pr-manager.h
blob50a77b08fcc0431f43616967a57b92861c626111
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"
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)
18 struct sg_io_hdr;
20 typedef struct PRManager {
21 /* <private> */
22 Object parent;
23 } PRManager;
25 /**
26 * PRManagerClass:
27 * @parent_class: the base class
28 * @run: callback invoked in thread pool context
30 typedef struct PRManagerClass {
31 /* <private> */
32 ObjectClass parent_class;
34 /* <public> */
35 int (*run)(PRManager *pr_mgr, int fd, struct sg_io_hdr *hdr);
36 bool (*is_connected)(PRManager *pr_mgr);
37 } PRManagerClass;
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,
44 void *opaque);
46 PRManager *pr_manager_lookup(const char *id, Error **errp);
48 #endif