Skip to content

Commit

Permalink
virtio: console: Generate a kobject CHANGE event on adding 'name' att…
Browse files Browse the repository at this point in the history
…ribute

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>
  • Loading branch information
Amit Shah authored and Michael S. Tsirkin committed Mar 22, 2010
1 parent 220bf99 commit ec64213
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
@@ -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:
/*

0 comments on commit ec64213

Please sign in to comment.