Creating an IUCV device

6.10 z/VM guest

Use the connection attribute to create an IUCV device.

About this task

To define an IUCV device, write the user ID of the peer z/VM® guest and, optionally, a path name to /sys/bus/iucv/drivers/netiucv/connection.

Procedure

Issue a command of this form:
# echo <peer_id>.<path_name> > /sys/bus/iucv/drivers/netiucv/connection
Where:
<peer_id>
is the user ID of the z/VM guest you want to connect to.
.<path_name>
identifies an individual path to a peer z/VM guest. This specification is required for setting up multiple paths to the same peer z/VM guest. For setting up a single path to a particular peer z/VM guest, this specification is optional and can be omitted. The path name can be up to 16 characters long. The peer must use the same path name when setting up the peer interface.

The NETIUCV device driver interprets the specification as uppercase.

Results

An interface iucv<n> is created and the following corresponding sysfs directories:
  • /sys/bus/iucv/devices/netiucv<n>
  • /sys/devices/iucv/netiucv<n>
  • /sys/class/net/iucv<n>

<n> is an index number that identifies an individual IUCV device and its corresponding interface. You can use the attributes of the sysfs entry to configure the device.

To find the index numbers that corresponds to a given user ID, scan the name attributes of all NETIUCV devices. Issue a command of this form:
# grep <peer_id> /sys/bus/iucv/drivers/netiucv/*/user

Example

To create an IUCV device to connect to a z/VM guest with a z/VM user ID LINUXP issue:

# echo linuxp > /sys/bus/iucv/drivers/netiucv/connection

To create another two IUCV devices to connect to the same z/VM guest LINUXP issue:

# echo linuxp.alt1 > /sys/bus/iucv/drivers/netiucv/connection
# echo linuxp.alt2 > /sys/bus/iucv/drivers/netiucv/connection
To find the device and interface that connect to LINUXP issue:
# grep -Hxi linuxp /sys/bus/iucv/devices/*/user
/sys/bus/iucv/devices/netiucv0/user:LINUXP
/sys/bus/iucv/devices/netiucv1/user:LINUXP.ALT1
/sys/bus/iucv/devices/netiucv2/user:LINUXP.ALT2
In the sample output, the device for the first path is netiucv0 and, therefore, the interface is iucv0. For the second and third paths, the devices are netiucv1 and netiucv2 and the corresponding interfaces are iucv1 and iucv2.