File: dump-xml.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 (24 lines) | stat: -rw-r--r-- 374 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- perl -*-

use strict;
use warnings;
use Sys::Virt;

my $addr = "";
if (@ARGV == 2) {
    $addr = shift @ARGV;
}

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

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

my $name = shift @ARGV;

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

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