2019-08-28 14:00:19 +02:00
|
|
|
/*
|
|
|
|
* VMState interface
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009-2019 Red Hat Inc
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VMSTATE_IF_H
|
|
|
|
#define VMSTATE_IF_H
|
|
|
|
|
|
|
|
#include "qom/object.h"
|
|
|
|
|
|
|
|
#define TYPE_VMSTATE_IF "vmstate-if"
|
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
typedef struct VMStateIfClass VMStateIfClass;
|
2020-08-31 23:07:33 +02:00
|
|
|
DECLARE_CLASS_CHECKERS(VMStateIfClass, VMSTATE_IF,
|
|
|
|
TYPE_VMSTATE_IF)
|
2019-08-28 14:00:19 +02:00
|
|
|
#define VMSTATE_IF(obj) \
|
|
|
|
INTERFACE_CHECK(VMStateIf, (obj), TYPE_VMSTATE_IF)
|
|
|
|
|
|
|
|
typedef struct VMStateIf VMStateIf;
|
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
struct VMStateIfClass {
|
2019-08-28 14:00:19 +02:00
|
|
|
InterfaceClass parent_class;
|
|
|
|
|
|
|
|
char * (*get_id)(VMStateIf *obj);
|
2020-09-03 22:43:22 +02:00
|
|
|
};
|
2019-08-28 14:00:19 +02:00
|
|
|
|
|
|
|
static inline char *vmstate_if_get_id(VMStateIf *vmif)
|
|
|
|
{
|
|
|
|
if (!vmif) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return VMSTATE_IF_GET_CLASS(vmif)->get_id(vmif);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* VMSTATE_IF_H */
|