diff options
Diffstat (limited to 'chardev/testdev.c')
-rw-r--r-- | chardev/testdev.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chardev/testdev.c b/chardev/testdev.c index 368a8c041e..a92caca3c3 100644 --- a/chardev/testdev.c +++ b/chardev/testdev.c @@ -27,19 +27,21 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "chardev/char.h" +#include "qom/object.h" #define BUF_SIZE 32 -typedef struct { +struct TestdevChardev { Chardev parent; uint8_t in_buf[32]; int in_buf_used; -} TestdevChardev; +}; +typedef struct TestdevChardev TestdevChardev; #define TYPE_CHARDEV_TESTDEV "chardev-testdev" -#define TESTDEV_CHARDEV(obj) \ - OBJECT_CHECK(TestdevChardev, (obj), TYPE_CHARDEV_TESTDEV) +DECLARE_INSTANCE_CHECKER(TestdevChardev, TESTDEV_CHARDEV, + TYPE_CHARDEV_TESTDEV) /* Try to interpret a whole incoming packet */ static int testdev_eat_packet(TestdevChardev *testdev) |