summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-03-19 15:06:43 +0300
committerMichael S. Tsirkin <mst@redhat.com>2010-03-22 15:24:53 +0300
commitec64213c4d482ee4d15b34511441eaecdd002adf (patch)
tree58f9ada4b6c82fffe9e0da2b72aa64bf879a5718
parent220bf991b0366cc50a94feede3d7341fa5710ee4 (diff)
downloadlinux-ec64213c4d482ee4d15b34511441eaecdd002adf.tar.xz
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>
-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,
*/
err = sysfs_create_group(&port->dev->kobj,
&port_attribute_group);
- if (err)
+ if (err) {
dev_err(port->dev,
"Error %d creating sysfs device attributes\n",
err);
-
+ } else {
+ /*
+ * Generate a udev event so that appropriate
+ * symlinks can be created based on udev
+ * rules.
+ */
+ kobject_uevent(&port->dev->kobj, KOBJ_CHANGE);
+ }
break;
case VIRTIO_CONSOLE_PORT_REMOVE:
/*