Skip to content

Commit 932c490

Browse files
Maximilian Immanuel Brandtnermstsirkin
authored andcommitted
virtio: console: Make resize control event handling compliant with spec
According to section 5.3.6.2 of the virtio spec a control buffer with the event VIRITO_CONSOLE_RESIZE is followed by a virtio_console_resize struct containing 2 little endian 16bit integerts cols,rows. The kernel implementation assums native endianness (which results in mangled values on big endian architectures)(a seperate patch by Halil Pasic will deal with that issue) and swaps the ordering of columns and rows. This patch changes the ordering of rows and columns to columns then rows. Fixes: 8345adb ("virtio: console: Accept console size along with resize control message") Signed-off-by: Maximilian Immanuel Brandtner <[email protected]> Cc: [email protected] # v2.6.35+ Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 2e2f925 commit 932c490

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/char/virtio_console.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,8 +1576,8 @@ static void handle_control_message(struct virtio_device *vdev,
15761576
break;
15771577
case VIRTIO_CONSOLE_RESIZE: {
15781578
struct {
1579-
__u16 rows;
15801579
__u16 cols;
1580+
__u16 rows;
15811581
} size;
15821582

15831583
if (!is_console_port(port))

0 commit comments

Comments
 (0)