From d25aef1ad97523ce14ae51bfd2208e18267a399e Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Wed, 19 May 2010 22:15:47 -0600 Subject: [PATCH] --- yaml --- r: 197863 b: refs/heads/master c: eaeff9608a8cf43a676b6f4b6235ea9d76192230 h: refs/heads/master i: 197861: b051086596588810fd1d25a49b528b7ba8acbcf5 197859: d5af60e943246104839d21341f9f06c1af3c6333 197855: 253131d33f1f3744def39fc060c9c3566bac290c v: v3 --- [refs] | 2 +- trunk/drivers/char/virtio_console.c | 5 +++++ trunk/include/linux/virtio_console.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 8714a58f0dc7..1af4bf3c63ea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3425e706bf6faa2965c4e99f39085f7367a8f4e2 +refs/heads/master: eaeff9608a8cf43a676b6f4b6235ea9d76192230 diff --git a/trunk/drivers/char/virtio_console.c b/trunk/drivers/char/virtio_console.c index 8c24b86aadc9..f63bf77a4825 100644 --- a/trunk/drivers/char/virtio_console.c +++ b/trunk/drivers/char/virtio_console.c @@ -1210,6 +1210,8 @@ static int add_port(struct ports_device *portdev, u32 id) free_port: kfree(port); fail: + /* The host might want to notify management sw about port add failure */ + send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 0); return err; } @@ -1488,6 +1490,9 @@ static int __devinit virtcons_probe(struct virtio_device *vdev) free: kfree(portdev); fail: + /* The host might want to notify mgmt sw about device add failure */ + __send_control_msg(portdev, VIRTIO_CONSOLE_BAD_ID, + VIRTIO_CONSOLE_DEVICE_READY, 0); return err; } diff --git a/trunk/include/linux/virtio_console.h b/trunk/include/linux/virtio_console.h index ae4f039515b4..015736113c25 100644 --- a/trunk/include/linux/virtio_console.h +++ b/trunk/include/linux/virtio_console.h @@ -14,6 +14,8 @@ #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ +#define VIRTIO_CONSOLE_BAD_ID (~(u32)0) + struct virtio_console_config { /* colums of the screens */ __u16 cols; @@ -42,6 +44,7 @@ struct virtio_console_control { #define VIRTIO_CONSOLE_PORT_OPEN 3 #define VIRTIO_CONSOLE_PORT_NAME 4 #define VIRTIO_CONSOLE_PORT_REMOVE 5 +#define VIRTIO_CONSOLE_DEVICE_READY 6 #ifdef __KERNEL__ int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));