Commit 64386ed7 authored by Mike Hibler's avatar Mike Hibler

Properly dump info for whole disk images created through the EZ form.

For the backend script to properly grok it, we must set wholedisk=1 and
loadpart=<which ever partN_osid is defined>.

Anal alert: output the attributes in sorted order, cuz that is the kinda
guy I am.
parent bbdf683e
......@@ -143,10 +143,22 @@ sub DumpImage($)
if (defined($osinfo->osfeatures()) && $osinfo->osfeatures() ne "");
$xmlfields{"reboot_waittime"} = $osinfo->reboot_waittime()
if (defined($osinfo->reboot_waittime()));
# whole disk images are described differently in EZ format
if ($image->loadpart() == 0 && $image->loadlength() == 4) {
$xmlfields{"wholedisk"} = 1;
# find the partition which has an osid defined
for (my $i = 1; $i <= 4; $i++) {
my $foo = $image->field("part${i}_osid");
if (defined($foo)) {
$xmlfields{"loadpart"} = $i;
last;
}
}
}
}
print "<image>\n";
foreach my $key (keys(%xmlfields)) {
foreach my $key (sort keys(%xmlfields)) {
my $val = $xmlfields{$key};
print " <attribute name=\"$key\">";
......@@ -194,7 +206,7 @@ sub DumpOS($)
}
print "<osid>\n";
foreach my $key (keys(%xmlfields)) {
foreach my $key (sort keys(%xmlfields)) {
my $val = $xmlfields{$key};
print " <attribute name=\"$key\">";
......
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