Skip to content

Commit

Permalink
kiss-vm vmhomedir: add empty arg check
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhong Yin <[email protected]>
  • Loading branch information
tcler committed Sep 22, 2023
1 parent 75da826 commit bb1d51b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kiss-vm
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ vmhomedir() {
local _vmname=$(vmname_extract -all "$1")
local _vmdir= _image=

if test -z "$_vmname"; then
echo "{VM:WARN} a vmname is needed" >&2
return 1
fi

read _type _dev _target _image < <(_vmblklist $_vmname '\.(qcow2|qcow|raw)')
if test -n "$_image"; then
_vmdir=$(dirname $_image)
Expand Down

0 comments on commit bb1d51b

Please sign in to comment.