File: devices.pl

package info (click to toggle)
libsys-virt-perl 11.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,088 kB
  • sloc: perl: 2,187; sh: 12; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 290 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*- perl -*-
use strict;
use warnings;
use Sys::Virt;

my $addr = @ARGV ? shift @ARGV : undef;

my $con = Sys::Virt->new(address => $addr, readonly => 1);


my @devs = $con->list_node_devices("net");

print "Available NICS\n";
foreach (@devs) {
    print "NIC: ", $_->get_name(), "\n";
}