summaryrefslogtreecommitdiff
path: root/hw/virtio-console.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-02-24 11:14:12 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2011-02-24 11:25:38 -0600
commita43f9c90c9129d1f28e473277abf793d0caed897 (patch)
treedf9fe4f975576a724b813437644061dfbe88a237 /hw/virtio-console.c
parent61a11c98b77bb27dda7b2fb7004371bf0437ae5d (diff)
virtio-serial: kill VirtIOSerialDevice
VirtIOSerialDevice is like VirtIOSerialPort with just the first two fields, which makes it pretty pointless. Using VirtIOSerialPort directly works equally well and is less confusing. [Amit: - rebase - rename 'dev' to 'port' in function params in virtio-serial.h ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-console.c')
-rw-r--r--hw/virtio-console.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 62624ec780..c235b2726c 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -57,10 +57,8 @@ static void chr_event(void *opaque, int event)
}
}
-static int generic_port_init(VirtConsole *vcon, VirtIOSerialDevice *dev)
+static int generic_port_init(VirtConsole *vcon, VirtIOSerialPort *port)
{
- vcon->port.info = dev->info;
-
if (vcon->chr) {
qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read, chr_event,
vcon);
@@ -70,18 +68,16 @@ static int generic_port_init(VirtConsole *vcon, VirtIOSerialDevice *dev)
}
/* Virtio Console Ports */
-static int virtconsole_initfn(VirtIOSerialDevice *dev)
+static int virtconsole_initfn(VirtIOSerialPort *port)
{
- VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev);
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
port->is_console = true;
- return generic_port_init(vcon, dev);
+ return generic_port_init(vcon, port);
}
-static int virtconsole_exitfn(VirtIOSerialDevice *dev)
+static int virtconsole_exitfn(VirtIOSerialPort *port)
{
- VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev);
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
if (vcon->chr) {
@@ -113,12 +109,11 @@ static void virtconsole_register(void)
device_init(virtconsole_register)
/* Generic Virtio Serial Ports */
-static int virtserialport_initfn(VirtIOSerialDevice *dev)
+static int virtserialport_initfn(VirtIOSerialPort *port)
{
- VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev);
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
- return generic_port_init(vcon, dev);
+ return generic_port_init(vcon, port);
}
static VirtIOSerialPortInfo virtserialport_info = {