[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] [question] why only one vport in /dev/char/ when Iuse
From: |
Zhang Haoyu |
Subject: |
Re: [Qemu-discuss] [question] why only one vport in /dev/char/ when Iuse qemu option "-device virtio-serial, max_ports=2" |
Date: |
Mon, 15 Sep 2014 08:51:25 +0800 |
>Hi, Amit,
>I start a VM with the option "-device virtio-serial,max_ports=2", but only one
>vport I can see in /dev/char/,
>I read the source,
>
>guest virtio console driver
> qemu virtio-serial
>
>virtcons_probe
> |
>init_vqs
> |
>__send_control_msg(
> VIRTIO_CONSOLE_DEVICE_READY) =====> control_out
>
> |
>
> handle_control_message
>
> |
>
> QTAILQ_FOREACH(port, &vser->ports, next) {
>control_intr <=====
> send_control_event(VIRTIO_CONSOLE_PORT_ADD) }
> |
>control_work_handler
> |
>add_port
> |
>device_create("vport%up%u")
>
>And, I add debug log in virtser_port_device_realize(), find that
>virtser_port_device_realize() was called only once,
>i.e., only one port in vser->ports, why?
>
I got the reason, only one -device virtserialport configured, so only one port
in vser->ports.
>How does max_ports option take effection ?
>
>Thanks,
>Zhang Haoyu