vmstate-if.h 874 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * VMState interface
  3. *
  4. * Copyright (c) 2009-2019 Red Hat Inc
  5. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  6. * See the COPYING file in the top-level directory.
  7. */
  8. #ifndef VMSTATE_IF_H
  9. #define VMSTATE_IF_H
  10. #include "qom/object.h"
  11. #define TYPE_VMSTATE_IF "vmstate-if"
  12. typedef struct VMStateIfClass VMStateIfClass;
  13. DECLARE_CLASS_CHECKERS(VMStateIfClass, VMSTATE_IF,
  14. TYPE_VMSTATE_IF)
  15. #define VMSTATE_IF(obj) \
  16. INTERFACE_CHECK(VMStateIf, (obj), TYPE_VMSTATE_IF)
  17. typedef struct VMStateIf VMStateIf;
  18. struct VMStateIfClass {
  19. InterfaceClass parent_class;
  20. char * (*get_id)(VMStateIf *obj);
  21. };
  22. static inline char *vmstate_if_get_id(VMStateIf *vmif)
  23. {
  24. if (!vmif) {
  25. return NULL;
  26. }
  27. return VMSTATE_IF_GET_CLASS(vmif)->get_id(vmif);
  28. }
  29. #endif /* VMSTATE_IF_H */