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