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
18a4a4d5
Commit
18a4a4d5
authored
Sep 01, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1407 from hiroyuki-sato/patch_for_packer
builder/qemu: add machine_type option for qemu builder.
parents
6b07803d
965d2739
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
builder/qemu/builder.go
builder/qemu/builder.go
+6
-0
builder/qemu/step_run.go
builder/qemu/step_run.go
+1
-1
No files found.
builder/qemu/builder.go
View file @
18a4a4d5
...
...
@@ -67,6 +67,7 @@ type config struct {
ISOChecksum
string
`mapstructure:"iso_checksum"`
ISOChecksumType
string
`mapstructure:"iso_checksum_type"`
ISOUrls
[]
string
`mapstructure:"iso_urls"`
MachineType
string
`mapstructure:"machine_type"`
NetDevice
string
`mapstructure:"net_device"`
OutputDir
string
`mapstructure:"output_directory"`
QemuArgs
[][]
string
`mapstructure:"qemuargs"`
...
...
@@ -127,6 +128,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
b
.
config
.
HTTPPortMax
=
9000
}
if
b
.
config
.
MachineType
==
""
{
b
.
config
.
MachineType
=
"pc-1.0"
}
if
b
.
config
.
OutputDir
==
""
{
b
.
config
.
OutputDir
=
fmt
.
Sprintf
(
"output-%s"
,
b
.
config
.
PackerBuildName
)
}
...
...
@@ -205,6 +210,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
"shutdown_timeout"
:
&
b
.
config
.
RawShutdownTimeout
,
"ssh_wait_timeout"
:
&
b
.
config
.
RawSSHWaitTimeout
,
"accelerator"
:
&
b
.
config
.
Accelerator
,
"machine_type"
:
&
b
.
config
.
MachineType
,
"net_device"
:
&
b
.
config
.
NetDevice
,
"disk_interface"
:
&
b
.
config
.
DiskInterface
,
}
...
...
builder/qemu/step_run.go
View file @
18a4a4d5
...
...
@@ -76,7 +76,7 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error
defaultArgs
:=
make
(
map
[
string
]
string
)
defaultArgs
[
"-name"
]
=
vmName
defaultArgs
[
"-machine"
]
=
fmt
.
Sprintf
(
"type=
pc-1.0,accel=%s"
,
config
.
Accelerator
)
defaultArgs
[
"-machine"
]
=
fmt
.
Sprintf
(
"type=
%s,accel=%s"
,
config
.
MachineType
,
config
.
Accelerator
)
defaultArgs
[
"-display"
]
=
guiArgument
defaultArgs
[
"-netdev"
]
=
"user,id=user.0"
defaultArgs
[
"-device"
]
=
fmt
.
Sprintf
(
"%s,netdev=user.0"
,
config
.
NetDevice
)
...
...
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