1515#include "trace.h"
1616#include "hw/virtio/virtio-serial.h"
1717
18- #define TYPE_VIRTIO_CONSOLE "virtconsole "
18+ #define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport "
1919#define VIRTIO_CONSOLE (obj ) \
20- OBJECT_CHECK(VirtConsole, (obj), TYPE_VIRTIO_CONSOLE )
20+ OBJECT_CHECK(VirtConsole, (obj), TYPE_VIRTIO_CONSOLE_SERIAL_PORT )
2121
2222typedef struct VirtConsole {
2323 VirtIOSerialPort parent_obj ;
@@ -154,28 +154,16 @@ static void virtconsole_unrealize(DeviceState *dev, Error **errp)
154154 }
155155}
156156
157- static Property virtconsole_properties [] = {
158- DEFINE_PROP_CHR ("chardev" , VirtConsole , chr ),
159- DEFINE_PROP_END_OF_LIST (),
160- };
161-
162157static void virtconsole_class_init (ObjectClass * klass , void * data )
163158{
164- DeviceClass * dc = DEVICE_CLASS (klass );
165159 VirtIOSerialPortClass * k = VIRTIO_SERIAL_PORT_CLASS (klass );
166160
167161 k -> is_console = true;
168- k -> realize = virtconsole_realize ;
169- k -> unrealize = virtconsole_unrealize ;
170- k -> have_data = flush_buf ;
171- k -> set_guest_connected = set_guest_connected ;
172- dc -> props = virtconsole_properties ;
173162}
174163
175164static const TypeInfo virtconsole_info = {
176- .name = TYPE_VIRTIO_CONSOLE ,
177- .parent = TYPE_VIRTIO_SERIAL_PORT ,
178- .instance_size = sizeof (VirtConsole ),
165+ .name = "virtconsole" ,
166+ .parent = TYPE_VIRTIO_CONSOLE_SERIAL_PORT ,
179167 .class_init = virtconsole_class_init ,
180168};
181169
@@ -197,16 +185,16 @@ static void virtserialport_class_init(ObjectClass *klass, void *data)
197185}
198186
199187static const TypeInfo virtserialport_info = {
200- .name = "virtserialport" ,
188+ .name = TYPE_VIRTIO_CONSOLE_SERIAL_PORT ,
201189 .parent = TYPE_VIRTIO_SERIAL_PORT ,
202190 .instance_size = sizeof (VirtConsole ),
203191 .class_init = virtserialport_class_init ,
204192};
205193
206194static void virtconsole_register_types (void )
207195{
208- type_register_static (& virtconsole_info );
209196 type_register_static (& virtserialport_info );
197+ type_register_static (& virtconsole_info );
210198}
211199
212200type_init (virtconsole_register_types )
0 commit comments