diff options
| -rw-r--r-- | drivers/char/virtio_console.c | 5 | ||||
| -rw-r--r-- | include/linux/virtio_console.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 8c24b86aadc9..f63bf77a4825 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
| @@ -1210,6 +1210,8 @@ free_cdev: | |||
| 1210 | free_port: | 1210 | free_port: |
| 1211 | kfree(port); | 1211 | kfree(port); |
| 1212 | fail: | 1212 | fail: |
| 1213 | /* The host might want to notify management sw about port add failure */ | ||
| 1214 | send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 0); | ||
| 1213 | return err; | 1215 | return err; |
| 1214 | } | 1216 | } |
| 1215 | 1217 | ||
| @@ -1488,6 +1490,9 @@ free_chrdev: | |||
| 1488 | free: | 1490 | free: |
| 1489 | kfree(portdev); | 1491 | kfree(portdev); |
| 1490 | fail: | 1492 | fail: |
| 1493 | /* The host might want to notify mgmt sw about device add failure */ | ||
| 1494 | __send_control_msg(portdev, VIRTIO_CONSOLE_BAD_ID, | ||
| 1495 | VIRTIO_CONSOLE_DEVICE_READY, 0); | ||
| 1491 | return err; | 1496 | return err; |
| 1492 | } | 1497 | } |
| 1493 | 1498 | ||
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index ae4f039515b4..015736113c25 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ | 14 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ |
| 15 | #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ | 15 | #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ |
| 16 | 16 | ||
| 17 | #define VIRTIO_CONSOLE_BAD_ID (~(u32)0) | ||
| 18 | |||
| 17 | struct virtio_console_config { | 19 | struct virtio_console_config { |
| 18 | /* colums of the screens */ | 20 | /* colums of the screens */ |
| 19 | __u16 cols; | 21 | __u16 cols; |
| @@ -42,6 +44,7 @@ struct virtio_console_control { | |||
| 42 | #define VIRTIO_CONSOLE_PORT_OPEN 3 | 44 | #define VIRTIO_CONSOLE_PORT_OPEN 3 |
| 43 | #define VIRTIO_CONSOLE_PORT_NAME 4 | 45 | #define VIRTIO_CONSOLE_PORT_NAME 4 |
| 44 | #define VIRTIO_CONSOLE_PORT_REMOVE 5 | 46 | #define VIRTIO_CONSOLE_PORT_REMOVE 5 |
| 47 | #define VIRTIO_CONSOLE_DEVICE_READY 6 | ||
| 45 | 48 | ||
| 46 | #ifdef __KERNEL__ | 49 | #ifdef __KERNEL__ |
| 47 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); | 50 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); |
