This commit is contained in:
Mitchell Hashimoto 2014-10-28 08:43:19 -07:00
parent 98a52c296c
commit 06144cf287
6 changed files with 14 additions and 14 deletions

View File

@ -8,8 +8,8 @@ import (
// Artifact is the result of running the Qemu builder, namely a set
// of files associated with the resulting machine.
type Artifact struct {
dir string
f []string
dir string
f []string
state map[string]interface{}
}

View File

@ -500,8 +500,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
}
artifact := &Artifact{
dir: b.config.OutputDir,
f: files,
dir: b.config.OutputDir,
f: files,
state: make(map[string]interface{}),
}

View File

@ -27,9 +27,9 @@ func (s *stepCopyDisk) Run(state multistep.StateBag) multistep.StepAction {
path,
}
if config.DiskImage == false {
return multistep.ActionContinue
}
if config.DiskImage == false {
return multistep.ActionContinue
}
ui.Say("Copying hard drive...")
if err := driver.QemuImg(command...); err != nil {

View File

@ -26,9 +26,9 @@ func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction {
fmt.Sprintf("%vM", config.DiskSize),
}
if config.DiskImage == true {
return multistep.ActionContinue
}
if config.DiskImage == true {
return multistep.ActionContinue
}
ui.Say("Creating hard drive...")
if err := driver.QemuImg(command...); err != nil {

View File

@ -25,9 +25,9 @@ func (s *stepResizeDisk) Run(state multistep.StateBag) multistep.StepAction {
fmt.Sprintf("%vM", config.DiskSize),
}
if config.DiskImage == false {
return multistep.ActionContinue
}
if config.DiskImage == false {
return multistep.ActionContinue
}
ui.Say("Resizing hard drive...")
if err := driver.QemuImg(command...); err != nil {

View File

@ -29,7 +29,7 @@ func (p *LibVirtProvider) Process(ui packer.Ui, artifact packer.Artifact, dir st
format := artifact.State("diskType").(string)
origSize := artifact.State("diskSize").(uint64)
size := origSize / 1024 // In MB, want GB
if origSize % 1024 > 0 {
if origSize%1024 > 0 {
// Make sure we don't make the size smaller
size++
}