Commit 48a4dfcd authored by Leigh B Stoller's avatar Leigh B Stoller

Use sitevar for default XEN parent image.

parent 2b935452
<?php <?php
# #
# Copyright (c) 2006-2015 University of Utah and the Flux Group. # Copyright (c) 2006-2016 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -1097,12 +1097,16 @@ class Image ...@@ -1097,12 +1097,16 @@ class Image
$version = $this->version(); $version = $this->version();
if ($does) { if ($does) {
$parentosinfo = OSinfo::LookupByName("emulab-ops", if (TBSiteVarExists("general/default_xen_parentosid")) {
"XEN43-64-STD"); $xenname = TBGetSiteVar("general/default_xen_parentosid");
}
else {
$xenname = "emulab-ops,XEN43-64-STD";
}
list($pid,$osname) = preg_split('/,/', $xenname);
$parentosinfo = OSinfo::LookupByName($pid,$osname);
if (!$parentosinfo) { if (!$parentosinfo) {
$parentosinfo = OSinfo::LookupByName("emulab-ops", return -1;
"XEN41-64-STD");
return -1;
} }
$parentosid = $parentosinfo->osid(); $parentosid = $parentosinfo->osid();
...@@ -1113,14 +1117,6 @@ class Image ...@@ -1113,14 +1117,6 @@ class Image
" osid='$imageid', parent_osid='$parentosid'"); " osid='$imageid', parent_osid='$parentosid'");
DBQueryFatal("replace into osidtoimageid set ". DBQueryFatal("replace into osidtoimageid set ".
" osid='$imageid', type='pcvm', imageid='$imageid'"); " osid='$imageid', type='pcvm', imageid='$imageid'");
$parentosinfo = OSinfo::LookupByName("emulab-ops",
"XEN44-64-BIGFS");
if ($parentosinfo) {
$parentosid = $parentosinfo->osid();
DBQueryFatal("replace into os_submap set ".
" osid='$imageid', parent_osid='$parentosid'");
}
} }
else { else {
DBQueryFatal("delete from osidtoimageid ". DBQueryFatal("delete from osidtoimageid ".
......
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