提交 104369c8 编写于 作者: P Peter Maydell

Merge remote-tracking branch 'remotes/amit/for-2.1' into staging

* remotes/amit/for-2.1:
  virtio-serial-bus: keep port 0 reserved for virtconsole even on unplug
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
......@@ -797,10 +797,18 @@ static void add_port(VirtIOSerial *vser, uint32_t port_id)
static void remove_port(VirtIOSerial *vser, uint32_t port_id)
{
VirtIOSerialPort *port;
unsigned int i;
i = port_id / 32;
vser->ports_map[i] &= ~(1U << (port_id % 32));
/*
* Don't mark port 0 removed -- we explicitly reserve it for
* backward compat with older guests, ensure a virtconsole device
* unplug retains the reservation.
*/
if (port_id) {
unsigned int i;
i = port_id / 32;
vser->ports_map[i] &= ~(1U << (port_id % 32));
}
port = find_port_by_id(vser, port_id);
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册