From d367b8b521bbfaaca92dc4220afeea3c0d240732 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Tue, 18 Aug 2015 17:43:59 -0700 Subject: [PATCH 1/2] If is customized no file extension is added. The documentation has been updated to reflect this. --- website/source/docs/builders/qemu.html.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/source/docs/builders/qemu.html.markdown b/website/source/docs/builders/qemu.html.markdown index 651c69122..ab3935329 100644 --- a/website/source/docs/builders/qemu.html.markdown +++ b/website/source/docs/builders/qemu.html.markdown @@ -247,8 +247,10 @@ builder and not otherwise conflicting with the qemuargs): host port. - `vm_name` (string) - This is the name of the image (QCOW2 or IMG) file for - the new virtual machine, without the file extension. By default this is - "packer-BUILDNAME", where "BUILDNAME" is the name of the build. + the new virtual machine. By default this is "packer-BUILDNAME.FORMAT", where + `BUILDNAME` is the name of the build and `FORMAT` matches the `format` + option, above. If you customize this you must specify the file extension or + none will be used. - `vnc_port_min` and `vnc_port_max` (integer) - The minimum and maximum port to use for the VNC port on the host machine which is forwarded to the VNC From 55fadd96bccc3d762ca93cbc4d12b27f6117e196 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Tue, 18 Aug 2015 17:44:17 -0700 Subject: [PATCH 2/2] By default, Qemu will now have an extension added based on the file format. This is a change to more closely match behavior from 0.7.5. --- builder/qemu/builder.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builder/qemu/builder.go b/builder/qemu/builder.go index 4ac22b59b..39984d68b 100644 --- a/builder/qemu/builder.go +++ b/builder/qemu/builder.go @@ -201,14 +201,15 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { b.config.VNCPortMax = 6000 } - if b.config.VMName == "" { - b.config.VMName = fmt.Sprintf("packer-%s", b.config.PackerBuildName) - } - if b.config.Format == "" { b.config.Format = "qcow2" } + if b.config.VMName == "" { + b.config.VMName = fmt.Sprintf("packer-%s.%s", + b.config.PackerBuildName, b.config.Format) + } + if b.config.FloppyFiles == nil { b.config.FloppyFiles = make([]string, 0) }