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
1b23af26
Commit
1b23af26
authored
Feb 21, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #854 from qur/qemu-config-binary
builder/qemu: binary name to be configured
parents
d2fe49d6
a8993662
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
builder/qemu/builder.go
builder/qemu/builder.go
+8
-3
website/source/docs/builders/qemu.html.markdown
website/source/docs/builders/qemu.html.markdown
+5
-0
No files found.
builder/qemu/builder.go
View file @
1b23af26
...
...
@@ -55,6 +55,7 @@ type config struct {
common
.
PackerConfig
`mapstructure:",squash"`
Accelerator
string
`mapstructure:"accelerator"`
QemuBinary
string
`mapstructure:"qemu_binary"`
BootCommand
[]
string
`mapstructure:"boot_command"`
DiskInterface
string
`mapstructure:"disk_interface"`
DiskSize
uint
`mapstructure:"disk_size"`
...
...
@@ -110,6 +111,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
// Accumulate any errors
errs
:=
common
.
CheckUnusedConfig
(
md
)
if
b
.
config
.
QemuBinary
==
""
{
b
.
config
.
QemuBinary
=
"qemu-system-x86_64"
}
if
b
.
config
.
DiskSize
==
0
{
b
.
config
.
DiskSize
=
40000
}
...
...
@@ -372,7 +377,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
(
packer
.
Artifact
,
error
)
{
// Create the driver that we'll use to communicate with Qemu
driver
,
err
:=
b
.
newDriver
()
driver
,
err
:=
b
.
newDriver
(
b
.
config
.
QemuBinary
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Failed creating Qemu driver: %s"
,
err
)
}
...
...
@@ -471,8 +476,8 @@ func (b *Builder) Cancel() {
}
}
func
(
b
*
Builder
)
newDriver
()
(
Driver
,
error
)
{
qemuPath
,
err
:=
exec
.
LookPath
(
"qemu-system-x86_64"
)
func
(
b
*
Builder
)
newDriver
(
qemuBinary
string
)
(
Driver
,
error
)
{
qemuPath
,
err
:=
exec
.
LookPath
(
qemuBinary
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
website/source/docs/builders/qemu.html.markdown
View file @
1b23af26
...
...
@@ -192,6 +192,11 @@ Optional:
qemu-system-x86 -m 1024m --no-acpi -netdev user,id=mynet0,hostfwd=hostip:hostport-guestip:guestport -device virtio-net,netdev=mynet0"
</pre>
*
`qemu_binary`
(string) - The name of the Qemu binary to look for. This
defaults to "qemu-system-x86_64", but may need to be changed for some
platforms. For example "qemu-kvm", or "qemu-system-i386" may be a better
choice for some systems.
*
`output_directory`
(string) - This is the path to the directory where the
resulting virtual machine will be created. This may be relative or absolute.
If relative, the path is relative to the working directory when
`packer`
...
...
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