NAME

Protocol::Sys::Virt::UNIXSocket - Helper routines for parsing LibVirt Unix sockets

VERSION

v10.10.13

SYNOPSIS

use Protocol::Sys::Virt::UNIXSocket; # imports 'socket_path'

my $path = socket_path();

DESCRIPTION

Helper functions for LibVirt Unix sockets.

FUNCTIONS

socket_path

my $path = socket_path(type => 'system', mode => 'direct', readonly => 1);

Returns the path name of the socket with the given parameters. The following parameters may be given:

  • type

    • system (default)

    • user

  • mode

    • legacy (default)

    • direct

      In case the hypervisor value is missing, the function falls back to legacy mode.

  • readonly

    When passed with a non-zero value, returns the name of the read-only socket.

  • prefix

    Path to prepend to state directory name holding the sockets.

    Eg., prefix => '/var' causes sockets paths to be rooted at /var/run/libvirt instead of /run/libvirt .

  • hypervisor

    Specifies the name of the hypervisor to connect to; uses the same naming scheme as the protocol part of the URI.

    Example values are qemu and vbox.

  • driver

    Alternative name for hypervisor.

SEE ALSO

LibVirt, Sys::Virt

LICENSE AND COPYRIGHT

See the LICENSE file in this distribution.