Commit 6731f1d6 authored by Leigh Stoller's avatar Leigh Stoller

Switch to XEN43-64-STD for default, XEN41 is fallback.

parent e3ba7828
#
# Updates for geni racks.
#
# XXX Need to update the frisbee MFS for dom0mem edits.
#
use strict;
use libdb;
use emdb;
use libEmulab;
use EmulabConstants;
use OSinfo;
use Image;
my $impotent = 0;
my $XENIMAGE_STD = "XEN43-64-STD";
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
my $osinfo = OSinfo->LookupByName("XEN-STD");
if (!defined($osinfo)) {
print STDERR "Could not lookup XEN-STD\n";
return -1;
}
my $nextosinfo = OSinfo->LookupByName($XENIMAGE_STD);
if (!defined($nextosinfo)) {
print STDERR "Could not lookup $XENIMAGE_STD\n";
return -1;
}
if ($osinfo->SetNextOS($nextosinfo)) {
print STDERR "Could not set the nextosid for XEN-STD\n";
return -1;
}
if ($osinfo->SetParentOS($nextosinfo)) {
print STDERR "Could not set the parent osid for XEN-STD\n";
return -1;
}
if ($osinfo->SetRunsOnParent($nextosinfo)) {
print STDERR "Could not add os_submap entry for XEN-STD\n";
return -1;
}
#
# We use this to update to new version of XEN.
#
my $query_result =
DBQueryFatal("select og.osname,og.osid from os_info as og ".
"left join os_info as op on ".
" op.osid=og.def_parentosid ".
"where og.def_parentosid is not null and ".
" FIND_IN_SET('xen-host',op.osfeatures)");
while (my ($osname,$osid) = $query_result->fetchrow_array()) {
my $osinfo = OSinfo->Lookup($osid);
if (!defined($osinfo)) {
print STDERR "Could not lookup OSinfo $osname,$osid\n";
return -1;
}
print STDERR "Updating $osname,$osid to run on $XENIMAGE_STD\n";
if ($osinfo->SetParentOS($nextosinfo)) {
print STDERR "Could not set the parent osid for $osname,$osid\n";
return -1;
}
if ($osinfo->SetRunsOnParent($nextosinfo)) {
print STDERR "Could not add os_submap entry for $osname,$osid\n";
return -1;
}
}
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
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