From c7ba8cd4a45d03c4a184bd48bbdca5715ca33b26 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Thu, 1 Aug 2013 23:32:02 -0400 Subject: [PATCH] fix(image_to_vm): Replace qemu's config file with a script. The recommended command using the config file was triggering a massive memory leak in qemu because it was adding both the default virtual hardware nic as well as the virtio nic. This could be worked around by adding something like -net none or moving all the -net commands from the file to the command line but eh. Clearly qemu config files are used and tested by nobody else so lets just use a trusty script instead. --- build_library/vm_image_util.sh | 50 ++++++++++++---------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index bd6093996d..174b5dd161 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -280,52 +280,36 @@ _write_qemu_conf() { local src_name=$(basename "$VM_SRC_IMG") local dst_name=$(basename "$VM_DST_IMG") local dst_dir=$(dirname "$VM_DST_IMG") - local conf_path="${dst_dir}/$(_src_to_dst_name "${src_name}" ".conf")" + local script="${dst_dir}/$(_src_to_dst_name "${src_name}" ".sh")" - # FIXME qemu 1.4/5 doesn't support these options in config files - # Seems like submitting a patch to fix that and documenting this - # format would be a worthy projects... - # name=${VM_NAME} - # uuid=${VM_UUID} - # m=${vm_mem} - # cpu=kvm64 - # smp=2 + cat >"${script}" <"${conf_path}" <"${VM_README}" <