Osstest/TestSupport: Hide $ho->{Toolstack} from casual use
PATCH 1/1 Osstest/TestSupport: Hide $ho->{Toolstack} from casual use
This should only be accessed via toolstack($ho), which is responsible for caching the value. Rename the field to _Toolstack to deter code from using it.
Signed-off-by Ian Campbell <[email protected]>
--- Osstest/TestSupport.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Osstest/TestSupport.pm +3 -3
@@ -2076,11 +2076,11 @@ sub guest_vncsnapshot_stash ($$$$) { sub toolstack ($) { my ($ho) = @_; - return $ho->{Toolstack} if $ho->{Toolstack}; + return $ho->{_Toolstack} if $ho->{_Toolstack}; my $tsname= $r{toolstack} || 'xend'; - $ho->{Toolstack}= get_host_method_object($ho, 'Toolstack', $tsname); - return $ho->{Toolstack}; + $ho->{_Toolstack}= get_host_method_object($ho, 'Toolstack', $tsname); + return $ho->{_Toolstack}; } sub authorized_keys () {
Signature · 1 line
2.1.4
Ian Campbell writes ("[PATCH OSSTEST] Osstest/TestSupport: Hide $ho->{Toolstack} from casual use"):
Quoted 3 lines
This should only be accessed via toolstack($ho), which is responsible for caching the value. Rename the field to
_Toolstackto deter code from using it.
Acked-by Ian Jackson <[email protected]>
Quoted 1 line · Ian Jackson
Acked-by Ian Jackson <[email protected]>
Added to pretest.