Skip to content

Commit

Permalink
virtio: console: Resize console port 0 on config intr only if multipo…
Browse files Browse the repository at this point in the history
…rt is off

When using multiport, we'll use control messages. Ensure we don't
accidentally update port 0 size on config interrupts.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
CC: Christian Borntraeger <borntraeger@de.ibm.com>
CC: linuxppc-dev@ozlabs.org
CC: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Amit Shah authored and Rusty Russell committed May 19, 2010
1 parent cdfadfc commit 4038f5b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,13 +1319,16 @@ static void config_intr(struct virtio_device *vdev)

portdev = vdev->priv;

/*
* We'll use this way of resizing only for legacy support.
* For newer userspace (VIRTIO_CONSOLE_F_MULTPORT+), use
* control messages to indicate console size changes so that
* it can be done per-port
*/
resize_console(find_port_by_id(portdev, 0));
if (!use_multiport(portdev)) {
/*
* We'll use this way of resizing only for legacy
* support. For newer userspace
* (VIRTIO_CONSOLE_F_MULTPORT+), use control messages
* to indicate console size changes so that it can be
* done per-port.
*/
resize_console(find_port_by_id(portdev, 0));
}
}

static int init_vqs(struct ports_device *portdev)
Expand Down

0 comments on commit 4038f5b

Please sign in to comment.