From 455d8132b09d94618d7957729a1d671ce5f8f425 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Mar 2026 06:56:14 +0100 Subject: [PATCH] fix: quote paths in buildV2VCommand to handle spaces in VM names --- plugins/module_utils/nbdkit/nbdkit.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/module_utils/nbdkit/nbdkit.go b/plugins/module_utils/nbdkit/nbdkit.go index 24d9cbb8..e2f59a8f 100644 --- a/plugins/module_utils/nbdkit/nbdkit.go +++ b/plugins/module_utils/nbdkit/nbdkit.go @@ -405,18 +405,19 @@ func versionIsLower(cVersion, rVersion string) bool { */ // buildV2VCommand constructs the virt-v2v-in-place command string. +// Paths are wrapped in single quotes to handle directory names with spaces. func buildV2VCommand(path, rsPath, bsPath, extraOpts string) string { opts := "" if rsPath != "" { - opts = opts + " --run " + rsPath + opts = opts + " --run '" + rsPath + "'" } if bsPath != "" { - opts = opts + " --firstboot " + bsPath + opts = opts + " --firstboot '" + bsPath + "'" } if extraOpts != "" { opts += " " + extraOpts } - return "virt-v2v-in-place" + opts + " -i disk " + path + return "virt-v2v-in-place" + opts + " -i disk '" + path + "'" } func V2VConversion(path, rsPath, bsPath, extraOpts string, debug bool) error {