canonical_device_name


Description:

[ Version ( since = "1.19.7" ) ]
public string canonical_device_name (string device) throws Error

return canonical device name

This utility function is useful when displaying device names to the user. It takes a number of irregular device names and returns them in a consistent format:

/dev/hdX /dev/vdX These are returned as /dev/sdX. Note this works for device names and partition names. This is approximately the reverse of the algorithm described in "BLOCK DEVICE NAMING" in guestfs(3).

/dev/mapper/VG-LV /dev/dm-N Converted to /dev/VG/LV form using lvm_canonical_lv_name.

Other strings are returned unmodified.

Parameters:

this

A GuestfsSession object

Returns:

the returned string, or NULL on error