Revision a43f9c90 hw/virtio-console.c

b/hw/virtio-console.c
57 57
    }
58 58
}
59 59

  
60
static int generic_port_init(VirtConsole *vcon, VirtIOSerialDevice *dev)
60
static int generic_port_init(VirtConsole *vcon, VirtIOSerialPort *port)
61 61
{
62
    vcon->port.info = dev->info;
63

  
64 62
    if (vcon->chr) {
65 63
        qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read, chr_event,
66 64
                              vcon);
......
70 68
}
71 69

  
72 70
/* Virtio Console Ports */
73
static int virtconsole_initfn(VirtIOSerialDevice *dev)
71
static int virtconsole_initfn(VirtIOSerialPort *port)
74 72
{
75
    VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev);
76 73
    VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
77 74

  
78 75
    port->is_console = true;
79
    return generic_port_init(vcon, dev);
76
    return generic_port_init(vcon, port);
80 77
}
81 78

  
82
static int virtconsole_exitfn(VirtIOSerialDevice *dev)
79
static int virtconsole_exitfn(VirtIOSerialPort *port)
83 80
{
84
    VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev);
85 81
    VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
86 82

  
87 83
    if (vcon->chr) {
......
113 109
device_init(virtconsole_register)
114 110

  
115 111
/* Generic Virtio Serial Ports */
116
static int virtserialport_initfn(VirtIOSerialDevice *dev)
112
static int virtserialport_initfn(VirtIOSerialPort *port)
117 113
{
118
    VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev);
119 114
    VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
120 115

  
121
    return generic_port_init(vcon, dev);
116
    return generic_port_init(vcon, port);
122 117
}
123 118

  
124 119
static VirtIOSerialPortInfo virtserialport_info = {

Also available in: Unified diff