Commit
3d835f7d made two incorrect assumptions that
lead to instance moves failing for plain instances.
- The Import/Export interface is available at the level
of block devices, not (as was assumed in the said
commit) at the level of configuration objects.
- The Import/Export functions provide an argv vector
not a single string; also the quoted version thereof
is not a parameter so be substituted into a shell
template (the quoted string does contain several
characters with special meaning to the shell, e.g.,
spaces).
Fix this now.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
elif ieio == constants.IEIO_RAW_DISK:
(disk, ) = ieargs
+ real_disk = _OpenRealBD(disk)
if mode == constants.IEM_IMPORT:
- suffix = utils.BuildShellCmd("| %s", disk.Import())
+ suffix = "| %s" % utils.ShellQuoteArgs(real_disk.Import())
elif mode == constants.IEM_EXPORT:
- prefix = utils.BuildShellCmd("%s |", disk.Export())
+ prefix = "%s |" % utils.ShellQuoteArgs(real_disk.Export())
exp_size = disk.size
elif ieio == constants.IEIO_SCRIPT: