virtio-console: Fix VIRTIO_CONSOLE() cast macro
commitbe21c336162f5f4269131faffb1c6461cf57b74a
authorAndreas Färber <afaerber@suse.de>
Thu, 13 Mar 2014 16:12:53 +0000 (13 17:12 +0100)
committerAndreas Färber <afaerber@suse.de>
Thu, 13 Mar 2014 20:12:07 +0000 (13 21:12 +0100)
treebb23ee9148fdc4f8dc117eda1684a0ba91353b90
parentbbbd67f0ccdba93702e58879997c1d2ca67311b1
virtio-console: Fix VIRTIO_CONSOLE() cast macro

Commit 0399a3819b27083ba69b88a9baa9025facab85bd (virtio-console: QOM
cast cleanup for VirtConsole) broke virtserialport since it shares
functions and state struct with virtconsole. Let virtconsole inherit
from virtserialport, and use virtserialport type for casting.

Note that virtio-serial-port is the abstract base type in
virtio-serial-bus.c, whereas virtserialport is the user-instantiatable
type in virtio-console.c. Therefore using TYPE_VIRTIO_CONSOLE_SERIAL_PORT.

Reported-by: Richard W.M. Jones <rjones@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/char/virtio-console.c