devices.pl 290 Bytes
Newer Older
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";
}