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: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2014-07-17 11:18:51 +01:00
commit 104369c8c7

View File

@ -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;
/*
* 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);
/*