Commit 995d700d authored by Kirk Webb's avatar Kirk Webb

Fix quibbles and omissions.

parent 666e66c7
......@@ -104,14 +104,14 @@ sub AllTypes($)
my $query_result =
DBQueryWarn("select distinct type from blockstore_type_attributes");
return undef
return ()
if (!$query_result || !$query_result->numrows);
while (my ($type) = $query_result->fetchrow_array()) {
my $typeinfo = Lookup($class, $type);
# Something went wrong?
return undef
return ()
if (!defined($typeinfo));
push(@alltypes, $typeinfo);
......
......@@ -37,7 +37,8 @@ LIB_STUFF = lanlink.tcl node.tcl sim.tcl tb_compat.tcl null.tcl \
elabinelab.ns elabinelab-withfsnode.ns elabinelab-opsvm.ns \
fw.ns timeline.tcl sequence.tcl \
topography.tcl console.tcl path.tcl \
disk.tcl custom.tcl elabinelab-xen.ns
disk.tcl custom.tcl elabinelab-xen.ns \
blockstore.tcl
BOSSLIBEXEC = parse-ns
USERLIBEXEC = parse.proxy
......
......@@ -94,7 +94,7 @@ Blockstore instproc set-type {newtype} {
}
Blockstore instproc set-size {newsize} {
set mindisksize [expr 2 ** 20]; # 1 MiB
set mindisksize [expr pow(2,20)]; # 1 MiB
# Convert various input size strings to bytes.
set convsize [convert_to_bytes $newsize]
......
......@@ -870,7 +870,7 @@ sub GenDefsFile($)
}
}
}
print TCL "\n\n";
print TCL "\n";
print TCL "# Storage Objects\n";
my @sotypes = BlockstoreType->AllTypes();
......@@ -885,10 +885,9 @@ sub GenDefsFile($)
print TCL "set soprotocols($proto) 1\n"
if defined($proto);
}
print TCL "\n\n";
print TCL "\n";
print TCL "}\n";
print TCL "}\n\n";
close(TCL);
}
......
......@@ -641,14 +641,14 @@ proc convert_to_bytes {size} {
switch -- $unit {
B {set val $sz}
KB {set val [expr int($sz * 10**3)]}
KiB {set val [expr int($sz * 2**10)]}
MB {set val [expr int($sz * 10**6)]}
MiB {set val [expr int($sz * 2**20)]}
GB {set val [expr int($sz * 10**9)]}
GiB {set val [expr int($sz * 2**30)]}
TB {set val [expr int($sz * 10**12)]}
TiB {set val [expr int($sz * 2**40)]}
KB {set val [expr int($sz * pow(10,3))]}
KiB {set val [expr int($sz * pow(2,10))]}
MB {set val [expr int($sz * pow(10,6))]}
MiB {set val [expr int($sz * pow(2,20))]}
GB {set val [expr int($sz * pow(10,9))]}
GiB {set val [expr int($sz * pow(2,30))]}
TB {set val [expr int($sz * pow(10,12))]}
TiB {set val [expr int($sz * pow(2,40))]}
default {
perror "Unknown size unit $unit."
set val 0
......
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