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

Fix quibbles and omissions.

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