run: make qemu-img more resilient to --prebuilt by not doing -T in that case

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-11-19 00:00:00 +00:00
parent 2684133597
commit 33f286b354

View File

@@ -538,8 +538,11 @@ def print_time(ellapsed_seconds):
def raw_to_qcow2(prebuilt=False, reverse=False):
if prebuilt:
disable_trace = []
qemu_img_executable = common.qemu_img_basename
else:
# Prevent qemu-img from generating trace files like QEMU. Disgusting.
disable_trace = ['-T', 'pr_manager_run,file=/dev/null', common.Newline,]
qemu_img_executable = common.qemu_img_executable
infmt = 'raw'
outfmt = 'qcow2'
@@ -552,16 +555,19 @@ def raw_to_qcow2(prebuilt=False, reverse=False):
tmp = infile
infile = outfile
outfile = tmp
common.run_cmd([
qemu_img_executable, common.Newline,
# Prevent qemu-img from generating trace files like QEMU. Disgusting.
'-T', 'pr_manager_run,file=/dev/null', common.Newline,
'convert', common.Newline,
'-f', infmt, common.Newline,
'-O', outfmt, common.Newline,
infile, common.Newline,
outfile, common.Newline,
])
common.run_cmd(
[
qemu_img_executable, common.Newline,
'convert', common.Newline,
] +
disable_trace +
[
'-f', infmt, common.Newline,
'-O', outfmt, common.Newline,
infile, common.Newline,
outfile, common.Newline,
]
)
def resolve_args(defaults, args, extra_args):
if extra_args is None: