Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
06144cf2
Commit
06144cf2
authored
Oct 28, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmt
parent
98a52c29
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
14 deletions
+14
-14
builder/qemu/artifact.go
builder/qemu/artifact.go
+2
-2
builder/qemu/builder.go
builder/qemu/builder.go
+2
-2
builder/qemu/step_copy_disk.go
builder/qemu/step_copy_disk.go
+3
-3
builder/qemu/step_create_disk.go
builder/qemu/step_create_disk.go
+3
-3
builder/qemu/step_resize_disk.go
builder/qemu/step_resize_disk.go
+3
-3
post-processor/vagrant/libvirt.go
post-processor/vagrant/libvirt.go
+1
-1
No files found.
builder/qemu/artifact.go
View file @
06144cf2
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
// Artifact is the result of running the Qemu builder, namely a set
// Artifact is the result of running the Qemu builder, namely a set
// of files associated with the resulting machine.
// of files associated with the resulting machine.
type
Artifact
struct
{
type
Artifact
struct
{
dir
string
dir
string
f
[]
string
f
[]
string
state
map
[
string
]
interface
{}
state
map
[
string
]
interface
{}
}
}
...
...
builder/qemu/builder.go
View file @
06144cf2
...
@@ -500,8 +500,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -500,8 +500,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
}
}
artifact
:=
&
Artifact
{
artifact
:=
&
Artifact
{
dir
:
b
.
config
.
OutputDir
,
dir
:
b
.
config
.
OutputDir
,
f
:
files
,
f
:
files
,
state
:
make
(
map
[
string
]
interface
{}),
state
:
make
(
map
[
string
]
interface
{}),
}
}
...
...
builder/qemu/step_copy_disk.go
View file @
06144cf2
...
@@ -27,9 +27,9 @@ func (s *stepCopyDisk) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -27,9 +27,9 @@ func (s *stepCopyDisk) Run(state multistep.StateBag) multistep.StepAction {
path
,
path
,
}
}
if
config
.
DiskImage
==
false
{
if
config
.
DiskImage
==
false
{
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
ui
.
Say
(
"Copying hard drive..."
)
ui
.
Say
(
"Copying hard drive..."
)
if
err
:=
driver
.
QemuImg
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
QemuImg
(
command
...
);
err
!=
nil
{
...
...
builder/qemu/step_create_disk.go
View file @
06144cf2
...
@@ -26,9 +26,9 @@ func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -26,9 +26,9 @@ func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction {
fmt
.
Sprintf
(
"%vM"
,
config
.
DiskSize
),
fmt
.
Sprintf
(
"%vM"
,
config
.
DiskSize
),
}
}
if
config
.
DiskImage
==
true
{
if
config
.
DiskImage
==
true
{
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
ui
.
Say
(
"Creating hard drive..."
)
ui
.
Say
(
"Creating hard drive..."
)
if
err
:=
driver
.
QemuImg
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
QemuImg
(
command
...
);
err
!=
nil
{
...
...
builder/qemu/step_resize_disk.go
View file @
06144cf2
...
@@ -25,9 +25,9 @@ func (s *stepResizeDisk) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -25,9 +25,9 @@ func (s *stepResizeDisk) Run(state multistep.StateBag) multistep.StepAction {
fmt
.
Sprintf
(
"%vM"
,
config
.
DiskSize
),
fmt
.
Sprintf
(
"%vM"
,
config
.
DiskSize
),
}
}
if
config
.
DiskImage
==
false
{
if
config
.
DiskImage
==
false
{
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
ui
.
Say
(
"Resizing hard drive..."
)
ui
.
Say
(
"Resizing hard drive..."
)
if
err
:=
driver
.
QemuImg
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
QemuImg
(
command
...
);
err
!=
nil
{
...
...
post-processor/vagrant/libvirt.go
View file @
06144cf2
...
@@ -29,7 +29,7 @@ func (p *LibVirtProvider) Process(ui packer.Ui, artifact packer.Artifact, dir st
...
@@ -29,7 +29,7 @@ func (p *LibVirtProvider) Process(ui packer.Ui, artifact packer.Artifact, dir st
format
:=
artifact
.
State
(
"diskType"
)
.
(
string
)
format
:=
artifact
.
State
(
"diskType"
)
.
(
string
)
origSize
:=
artifact
.
State
(
"diskSize"
)
.
(
uint64
)
origSize
:=
artifact
.
State
(
"diskSize"
)
.
(
uint64
)
size
:=
origSize
/
1024
// In MB, want GB
size
:=
origSize
/
1024
// In MB, want GB
if
origSize
%
1024
>
0
{
if
origSize
%
1024
>
0
{
// Make sure we don't make the size smaller
// Make sure we don't make the size smaller
size
++
size
++
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment