virtio: console: Let host know of port or device add failures

The host may want to know and let management apps notify of port or
device add failures. Send a control message saying the device or port is
not ready in this case.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Amit Shah
2010-05-19 22:15:47 -06:00
committed by Rusty Russell
parent 3425e706bf
commit eaeff9608a
2 changed files with 8 additions and 0 deletions

View File

@@ -1210,6 +1210,8 @@ free_cdev:
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 @@ free_chrdev:
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;
}