Commit faf25362 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add virDomainGetFSInfo API binding

parent e01c35dd
Revision history for perl module Sys::Virt
1.2.10 2014-00-00
- Add virDomainGetFSInfo API binding
1.2.9 2014-10-02
- Add VIR_DOMAIN_*_BANDWIDTH_BYTES constants
......
......@@ -5116,6 +5116,38 @@ PPCODE:
Safefree(mountPoints);
void
get_fs_info(dom, flags=0)
virDomainPtr dom;
unsigned int flags;
PREINIT:
virDomainFSInfoPtr *info;
int ninfo;
size_t i, j;
PPCODE:
if ((ninfo = virDomainGetFSInfo(dom, &info, flags)) < 0)
_croak_error();
EXTEND(SP, ninfo);
for (i = 0 ; i < ninfo ; i++) {
HV *hv = newHV();
AV *av = newAV();
(void)hv_store(hv, "mountpoint", 10, newSVpv(info[i]->mountpoint, 0), 0);
(void)hv_store(hv, "name", 4, newSVpv(info[i]->name, 0), 0);
(void)hv_store(hv, "fstype", 6, newSVpv(info[i]->fstype, 0), 0);
for (j = 0; j < info[i]->ndevAlias; j++)
av_push(av, newSVpv(info[i]->devAlias[j], 0));
(void)hv_store(hv, "devalias", 8, newRV_noinc((SV*)av), 0);
virDomainFSInfoFree(info[i]);
PUSHs(newRV_noinc((SV*)hv));
}
free(info);
void
send_process_signal(dom, pidsv, signum, flags=0)
......
#!/usr/bin/perl
use strict;
use warnings;
use Sys::Virt;
use Sys::Virt::Domain;
my $uri = @ARGV ? shift @ARGV : undef;
my $c = Sys::Virt->new(uri => $uri);
my $dom = $c->get_domain_by_name(shift @ARGV);
my @fs = $dom->get_fs_info();
use Data::Dumper;
print Dumper($fs[0]);
print Dumper($fs[1]);
......@@ -1626,6 +1626,35 @@ array reference. If <@mountPoints> is an empty list, then all
filesystems will be thawed. C<$flags> is currently
unused and defaults to zero.
=item @fslist = $dom->get_fs_info($flags=0);
Obtain a list of all guest filesystems. The returned list will
contain one element for each filesystem, whose value will be
a hash reference with the following keys
=over 4
=item name
The name of the guest device that is mounted
=item fstype
The filesystem type (eg 'ext4', 'fat', 'ntfs', etc)
=item mountpoint
The location in the filesystem tree of the mount
=item devalias
An array reference containing list of device aliases
associated with the guest device. The device aliases
correspond to disk target names in the guest XML
configuration
=back
=item $dom->send_process_signal($pid, $signum, $flags=0);
Send the process C<$pid> the signal C<$signum>. The
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment