aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-03-19 08:06:43 -0400
committerMichael S. Tsirkin <mst@redhat.com>2010-03-22 08:24:53 -0400
commitec64213c4d482ee4d15b34511441eaecdd002adf (patch)
tree58f9ada4b6c82fffe9e0da2b72aa64bf879a5718 /drivers/char
parent220bf991b0366cc50a94feede3d7341fa5710ee4 (diff)
virtio: console: Generate a kobject CHANGE event on adding 'name' attribute
When the host lets us know what 'name' a port is assigned, we create the sysfs 'name' attribute. Generate a 'change' event after this so that udev wakes up and acts on the rules for virtio-ports (currently there's only one rule that creates a symlink from the 'name' to the actual char device). Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/virtio_console.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index f404ccfc9c20..67b474b4167c 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -947,11 +947,18 @@ static void handle_control_message(struct ports_device *portdev,
947 */ 947 */
948 err = sysfs_create_group(&port->dev->kobj, 948 err = sysfs_create_group(&port->dev->kobj,
949 &port_attribute_group); 949 &port_attribute_group);
950 if (err) 950 if (err) {
951 dev_err(port->dev, 951 dev_err(port->dev,
952 "Error %d creating sysfs device attributes\n", 952 "Error %d creating sysfs device attributes\n",
953 err); 953 err);
954 954 } else {
955 /*
956 * Generate a udev event so that appropriate
957 * symlinks can be created based on udev
958 * rules.
959 */
960 kobject_uevent(&port->dev->kobj, KOBJ_CHANGE);
961 }
955 break; 962 break;
956 case VIRTIO_CONSOLE_PORT_REMOVE: 963 case VIRTIO_CONSOLE_PORT_REMOVE:
957 /* 964 /*