Commit f0cf6e1c authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Additions to previous revision (fixes for versioned images).

parent 27968df9
...@@ -6996,7 +6996,7 @@ sub InitializePhysNode($$$) ...@@ -6996,7 +6996,7 @@ sub InitializePhysNode($$$)
my $cmdline_role = "default"; my $cmdline_role = "default";
my $cmdline = ""; my $cmdline = "";
my $vname; my $vname;
my $osid; my ($osinfo, $osid);
my $routertype; my $routertype;
if ($role eq TBDB_RSRVROLE_DELAYNODE() || if ($role eq TBDB_RSRVROLE_DELAYNODE() ||
...@@ -7026,7 +7026,9 @@ sub InitializePhysNode($$$) ...@@ -7026,7 +7026,9 @@ sub InitializePhysNode($$$)
# An internal node hosting VMs. # An internal node hosting VMs.
# #
if (defined($virtnode->_parent_osinfo())) { if (defined($virtnode->_parent_osinfo())) {
$osid = $virtnode->_parent_osinfo()->osid(); # Do not want to lose version info, so use osinfo when we
# have it.
$osinfo = $virtnode->_parent_osinfo();
} }
else { else {
$osid = ($self->option("jail_osid") || $osid = ($self->option("jail_osid") ||
...@@ -7038,6 +7040,8 @@ sub InitializePhysNode($$$) ...@@ -7038,6 +7040,8 @@ sub InitializePhysNode($$$)
$self->exptstats()->{"jailnodes"} += 1; $self->exptstats()->{"jailnodes"} += 1;
} }
$osid = $osinfo->osid()
if (defined($osinfo));
if (!defined($osid)) { if (!defined($osid)) {
tberror("No OSID is defined for internal node $vname!\n"); tberror("No OSID is defined for internal node $vname!\n");
return -1; return -1;
...@@ -7070,9 +7074,15 @@ sub InitializePhysNode($$$) ...@@ -7070,9 +7074,15 @@ sub InitializePhysNode($$$)
# #
my ($cmdline,$rpms,$startupcmd,$tarfiles,$loadlist, my ($cmdline,$rpms,$startupcmd,$tarfiles,$loadlist,
$failureaction,$routertype) = @{ $virtnode->_settings() }; $failureaction,$routertype) = @{ $virtnode->_settings() };
$osid = (defined($virtnode->_osinfo()) ? # Do not want to lose version info, so use osinfo when we have it.
$virtnode->_osinfo()->osid() : $pnode->default_osid()); if (defined($virtnode->_osinfo())) {
$osinfo = $virtnode->_osinfo();
$osid = $osinfo->osid();
}
else {
$osid = $pnode->default_osid();
}
my $vname = $vnodename; my $vname = $vnodename;
my $inner_elab_role = $virtnode->inner_elab_role(); my $inner_elab_role = $virtnode->inner_elab_role();
my $plab_role = $virtnode->plab_role(); my $plab_role = $virtnode->plab_role();
...@@ -7165,11 +7175,14 @@ sub InitializePhysNode($$$) ...@@ -7165,11 +7175,14 @@ sub InitializePhysNode($$$)
# #
if (defined($osid) && (!$pnode->isremotenode() if (defined($osid) && (!$pnode->isremotenode()
|| $pnode->isdedicatedremote())) { || $pnode->isdedicatedremote())) {
# osselect wants an osinfo object. # osselect wants an osinfo object, but we do not always have
my $osinfo = OSinfo->Lookup($osid); # that. See above.
if (!defined($osinfo)) { if (!defined($osinfo)) {
tberror("Could not map $osid to osinfo object\n"); $osinfo = OSinfo->Lookup($osid);
return -1; if (!defined($osinfo)) {
tberror("Could not map $osid to osinfo object\n");
return -1;
}
} }
# #
# Map generic OSID to the specific one. # Map generic OSID to the specific one.
......
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