mirror of
https://github.com/qemu/qemu.git
synced 2024-12-13 05:33:34 +08:00
30b5707c26
One of the goals of having less boilerplate on QOM declarations is to avoid human error. Requiring an extra argument that is never used is an opportunity for mistakes. Remove the unused argument from OBJECT_DECLARE_TYPE and OBJECT_DECLARE_SIMPLE_TYPE. Coccinelle patch used to convert all users of the macros: @@ declarer name OBJECT_DECLARE_TYPE; identifier InstanceType, ClassType, lowercase, UPPERCASE; @@ OBJECT_DECLARE_TYPE(InstanceType, ClassType, - lowercase, UPPERCASE); @@ declarer name OBJECT_DECLARE_SIMPLE_TYPE; identifier InstanceType, lowercase, UPPERCASE; @@ OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, - lowercase, UPPERCASE); Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Acked-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Paul Durrant <paul@xen.org> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20200916182519.415636-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
43 lines
955 B
C
43 lines
955 B
C
#ifndef PR_MANAGER_H
|
|
#define PR_MANAGER_H
|
|
|
|
#include "qom/object.h"
|
|
#include "qapi/visitor.h"
|
|
#include "qom/object_interfaces.h"
|
|
#include "block/aio.h"
|
|
#include "qemu/coroutine.h"
|
|
|
|
#define TYPE_PR_MANAGER "pr-manager"
|
|
|
|
OBJECT_DECLARE_TYPE(PRManager, PRManagerClass,
|
|
PR_MANAGER)
|
|
|
|
struct sg_io_hdr;
|
|
|
|
struct PRManager {
|
|
/* <private> */
|
|
Object parent;
|
|
};
|
|
|
|
/**
|
|
* PRManagerClass:
|
|
* @parent_class: the base class
|
|
* @run: callback invoked in thread pool context
|
|
*/
|
|
struct PRManagerClass {
|
|
/* <private> */
|
|
ObjectClass parent_class;
|
|
|
|
/* <public> */
|
|
int (*run)(PRManager *pr_mgr, int fd, struct sg_io_hdr *hdr);
|
|
bool (*is_connected)(PRManager *pr_mgr);
|
|
};
|
|
|
|
bool pr_manager_is_connected(PRManager *pr_mgr);
|
|
int coroutine_fn pr_manager_execute(PRManager *pr_mgr, AioContext *ctx, int fd,
|
|
struct sg_io_hdr *hdr);
|
|
|
|
PRManager *pr_manager_lookup(const char *id, Error **errp);
|
|
|
|
#endif
|