Skip to contentSkip to conversation

rules: Add symlink rule for virtio ports

PATCH New Kay Sievers 2 participants 2 messages Jan 21, 2010

lore
Share & tools
lore

Kay Sievers

author Applied
#0 lore raw
Quoted 7 lines · Amit Shah

virtio ports spawned by the virtio_console.c driver can have 'names' assigned to them by hosts. The ports are distinguishable using these names. Make a rule to create a symlink to the chardev associated for a port with a name.

The symlink created is:
   /dev/virtio-ports/org.libvirt.console0 -> /dev/vport0p0

Applied.

Thanks,
Kay

#1 lore raw

PATCH 1/1 rules: Add symlink rule for virtio ports

virtio ports spawned by the virtio_console.c driver can have 'names' assigned to them by hosts. The ports are distinguishable using these names. Make a rule to create a symlink to the chardev associated for a port with a name.

The symlink created is:

    /dev/virtio-ports/org.libvirt.console0 -> /dev/vport0p0

if the first port for the first device was given a name of 'org.libvirt.console0'.

---
The series that introduces this functionality is currently in Rusty's queue and can be seen in linux-next:

http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commitdiff;h¾bf00791b72a68bbd90251133a9074d75c8c22a

 rules/rules.d/50-udev-default.rules |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
rules/rules.d/50-udev-default.rules +3 -0
index 374db50..f8556d1 100644
@@ -17,6 +17,9 @@ KERNEL="ppp",			MODE="0600"
 KERNEL="mwave",		GROUP="dialout"
 KERNEL="hvc*|hvsi*",		GROUP="dialout"
 
+# virtio serial / console ports
+KERNEL="vport*", SYMLINK+="virtio-ports/$ATTR{name}"
+
 # mem
 KERNEL="null|zero|full|random|urandom", MODE="0666"
 KERNEL="mem|kmem|port|nvram",	GROUP="kmem", MODE="0640"
Signature · 1 line
1.6.2.5