summaryrefslogtreecommitdiffstats
path: root/inspector
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2009-06-29 15:34:29 +0100
committerMatthew Booth <mbooth@redhat.com>2009-06-29 15:55:51 +0100
commit103fb55e6b1428366ab31a0f17484ef1baa68e96 (patch)
treea43035043376484c532430569cd12cdc25944dc2 /inspector
parent228b19aa9c28b03b339e8e23fcb46359e3ab617e (diff)
downloadlibguestfs-103fb55e6b1428366ab31a0f17484ef1baa68e96.tar.gz
libguestfs-103fb55e6b1428366ab31a0f17484ef1baa68e96.tar.xz
libguestfs-103fb55e6b1428366ab31a0f17484ef1baa68e96.zip
Output the config filename containing a modprobe alias in XML
This change affects the XML output: /operatingsystems/operatingsystem/modprobealiases/alias/text() => /operatingsystems/operatingsystem/modprobealiases/alias/modulename/text() Additionally there are two new elements: /operatingsystems/operatingsystem/modprobealiases/alias/augeas /operatingsystems/operatingsystem/modprobealiases/alias/file These contain information about the location of the alias directive. /augeas is an augeas path. /file is the path of the file containing the directive.
Diffstat (limited to 'inspector')
-rwxr-xr-xinspector/virt-inspector.pl27
1 files changed, 23 insertions, 4 deletions
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl
index b5d62ae8..553c36ad 100755
--- a/inspector/virt-inspector.pl
+++ b/inspector/virt-inspector.pl
@@ -672,6 +672,7 @@ sub assign_mount_points
} else {
$fs->{used} = 1
}
+ $fs->{spec} = $spec;
}
}
}
@@ -884,13 +885,22 @@ sub check_for_modprobe_aliases
@results = $g->aug_match($pattern);
for my $path ( @results ) {
+ $path =~ m{^/files(.*)/alias(?:\[\d*\])?$}
+ or die("$path doesn't match augeas pattern");
+ my $file = $1;
+
my $alias;
$alias = $g->aug_get($path);
my $modulename;
$modulename = $g->aug_get($path.'/modulename');
- $modprobe_aliases{$alias} = $modulename;
+ my %aliasinfo;
+ $aliasinfo{modulename} = $modulename;
+ $aliasinfo{augeas} = $path;
+ $aliasinfo{file} = $file;
+
+ $modprobe_aliases{$alias} = \%aliasinfo;
}
}
@@ -1040,7 +1050,7 @@ sub output_text_os
if (@keys) {
print " Modprobe aliases:\n";
foreach (@keys) {
- printf " %-30s %s\n", $_, $aliases{$_}
+ printf " %-30s %s\n", $_, $aliases{$_}->{modulename}
}
}
}
@@ -1122,7 +1132,8 @@ sub output_xml_os
foreach my $field ( [ "label" => "label" ],
[ "uuid" => "uuid" ],
[ "type" => "fstype" ],
- [ "content" => "content" ] ) {
+ [ "content" => "content" ],
+ [ "spec" => "spec" ] ) {
$xml->dataElement($field->[0], $filesystems->{$_}{$field->[1]})
if exists $filesystems->{$_}{$field->[1]};
}
@@ -1137,7 +1148,15 @@ sub output_xml_os
if (@keys) {
$xml->startTag("modprobealiases");
foreach (@keys) {
- $xml->dataElement("alias", $aliases{$_}, "device" => $_);
+ $xml->startTag("alias", "device" => $_);
+
+ foreach my $field ( [ "modulename" => "modulename" ],
+ [ "augeas" => "augeas" ],
+ [ "file" => "file" ] ) {
+ $xml->dataElement($field->[0], $aliases{$_}->{$field->[1]});
+ }
+
+ $xml->endTag("alias");
}
$xml->endTag("modprobealiases");
}