Commit 5344aaf7 authored by Mike Hibler's avatar Mike Hibler

Merge branch 'master' into arm64

parents 120e52bc e2c09d94
......@@ -131,7 +131,7 @@ INSERT INTO sitevariables VALUES ('protogeni/plc_url',NULL,'https://www.planet-l
INSERT INTO sitevariables VALUES ('nodecheck/collect',NULL,'0','When set, collect and record node hardware info in /proj/<pid>/nodecheck/.',0);
INSERT INTO sitevariables VALUES ('nodecheck/check',NULL,'0','When set, perform nodecheck at swapin.',0);
INSERT INTO sitevariables VALUES ('general/xenvifrouting',NULL,'0','Non-zero value says to use vif routing on XEN shared nodes.',0);
INSERT INTO sitevariables VALUES ('general/default_xen_parentosid',NULL,'emulab-ops,XEN43-64-STD','The default parent OSID to use for XEN capable images.',0);
INSERT INTO sitevariables VALUES ('storage/stdataset/usequotas',NULL,'0','If non-zero, enforce per-project dataset quotas',0);
INSERT INTO sitevariables VALUES ('storage/stdataset/maxextend',NULL,'2','Number of times a user can extend the lease (0 == unlimited)',0);
INSERT INTO sitevariables VALUES ('storage/stdataset/extendperiod',NULL,'1','Length (days) of each user-requested extention (0 == do not allow extensions)',0);
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
my $var = "general/default_xen_parentosid";
if (!TBSiteVarExists($var)) {
my $desc = "The default parent OSID to use for XEN capable images.";
my $defval = "emulab-ops,XEN43-64-STD";
DBQueryFatal("INSERT INTO sitevariables VALUES ".
"('$var',NULL,'$defval','$desc',0)");
}
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
......@@ -28,8 +28,7 @@ use Getopt::Std;
#
# Mark an image as running on XEN.
#
my $DEFAULT_PARENT = "XEN43-64-STD";
my @OTHER_PARENTS = ("XEN44-64-BIGFS", "XEN41-64-STD");
my @OTHER_PARENTS = ("XEN44-64-BIGFS", "XEN41-64-STD", "XEN43-64-STD");
sub usage()
{
......@@ -40,14 +39,14 @@ sub usage()
print STDERR " -n - Impotent mode\n";
print STDERR " -c - Clear XEN parent settings completely\n";
print STDERR " -a - Operate on all current XEN capable images\n";
print STDERR " -p - Set default parent; currently $DEFAULT_PARENT\n";
print STDERR " -p - Set default parent\n";
exit(1);
}
my $optlist = "acp:n";
my $doall = 0;
my $clear = 0;
my $impotent = 0;
my $parent = $DEFAULT_PARENT;
my $parent;
# Protos
sub fatal($);
......@@ -62,9 +61,13 @@ $| = 1;
#
use lib "/usr/testbed/lib";
use emdb;
use libEmulab;
use Image;
use OSinfo;
# Default parent for this site is a sitevar.
my $DEFAULT_PARENT = GetSiteVar("general/default_xen_parentosid");
my %options = ();
if (! getopts($optlist, \%options)) {
usage();
......@@ -82,6 +85,9 @@ if (defined($options{"p"})) {
$parent = $options{"p"};
@OTHER_PARENTS = ($DEFAULT_PARENT, @OTHER_PARENTS);
}
else {
$parent = $DEFAULT_PARENT;
}
usage()
if (!$doall && !@ARGV);
......@@ -139,9 +145,12 @@ if ($clear) {
#
# Find the "default" parent image and the list of others parents.
#
my $parent_image = Image->LookupByName($parent);
my $parent_image = Image->Lookup($parent);
if (!defined($parent_image)) {
fatal("No such parent $parent");
$parent_image = Image->LookupByName($parent);
if (!defined($parent_image)) {
fatal("No such parent $parent");
}
}
my $parent_osinfo = OSinfo->Lookup($parent_image->imageid());
if (!defined($parent_osinfo)) {
......
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