dump-xml.pl 374 Bytes
Newer Older
1 2
# -*- perl -*-

3 4
use strict;
use warnings;
5 6
use Sys::Virt;

7 8 9 10 11
my $addr = "";
if (@ARGV == 2) {
    $addr = shift @ARGV;
}

12
if (@ARGV != 1) {
13
    print STDERR "syntax: $0 [URI] DOMAIN-NAME\n";
14 15 16
    exit 1;
}

17
my $con = Sys::Virt->new(address => $addr, readonly => 1);
18 19 20 21 22 23 24

my $name = shift @ARGV;

my $dom = $con->get_domain_by_name($name);

print $dom->get_xml_description(), "\n";