Debian Codegraph @

examples/devices.pl

raw
1 # -*- perl -*-
2 use strict;
3 use warnings;
4 use Sys::Virt;
5
6 my $addr = @ARGV ? shift @ARGV : undef;
7
8 my $con = Sys::Virt->new(address => $addr, readonly => 1);
9
10
11 my @devs = $con->list_node_devices("net");
12
13 print "Available NICS\n";
14 foreach (@devs) {
15 print "NIC: ", $_->get_name(), "\n";
16 }