aboutsummaryrefslogtreecommitdiff
path: root/include/chardev/char.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/chardev/char.h')
-rw-r--r--include/chardev/char.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/include/chardev/char.h b/include/chardev/char.h
index 00589a6025..5874de57ea 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -226,11 +226,9 @@ int qemu_chr_write(Chardev *s, const uint8_t *buf, int len, bool write_all);
int qemu_chr_wait_connected(Chardev *chr, Error **errp);
#define TYPE_CHARDEV "chardev"
-#define CHARDEV(obj) OBJECT_CHECK(Chardev, (obj), TYPE_CHARDEV)
-#define CHARDEV_CLASS(klass) \
- OBJECT_CLASS_CHECK(ChardevClass, (klass), TYPE_CHARDEV)
-#define CHARDEV_GET_CLASS(obj) \
- OBJECT_GET_CLASS(ChardevClass, (obj), TYPE_CHARDEV)
+typedef struct ChardevClass ChardevClass;
+DECLARE_OBJ_CHECKERS(Chardev, ChardevClass,
+ CHARDEV, TYPE_CHARDEV)
#define TYPE_CHARDEV_NULL "chardev-null"
#define TYPE_CHARDEV_MUX "chardev-mux"
@@ -251,7 +249,7 @@ int qemu_chr_wait_connected(Chardev *chr, Error **errp);
#define CHARDEV_IS_PTY(chr) \
object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_PTY)
-typedef struct ChardevClass {
+struct ChardevClass {
ObjectClass parent_class;
bool internal; /* TODO: eventually use TYPE_USER_CREATABLE */
@@ -276,7 +274,7 @@ typedef struct ChardevClass {
void (*chr_be_event)(Chardev *s, QEMUChrEvent event);
/* Return 0 if succeeded, 1 if failed */
int (*chr_machine_done)(Chardev *chr);
-} ChardevClass;
+};
Chardev *qemu_chardev_new(const char *id, const char *typename,
ChardevBackend *backend, GMainContext *context,