/* Virtio Console Ports */ static int virtconsole_initfn(VirtIOSerialPort *port) { VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port); port->is_console = true; return generic_port_init(vcon, port); }
/* Generic Virtio Serial Ports */ static int virtserialport_initfn(VirtIOSerialDevice *dev) { VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, &dev->qdev); VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port); return generic_port_init(vcon, dev); }
/* Generic Virtio Serial Ports */ static int virtserialport_initfn(VirtIOSerialPort *port) { VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port); if (port->id == 0) { /* * Disallow a generic port at id 0, that's reserved for * console ports. */ error_report("Port number 0 on virtio-serial devices reserved for virtconsole devices for backward compatibility."); return -1; } return generic_port_init(vcon, port); }