aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vm/qemu/qemu.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go
index 6ebf7e8ec..4173e2c6f 100644
--- a/vm/qemu/qemu.go
+++ b/vm/qemu/qemu.go
@@ -30,14 +30,15 @@ func init() {
}
type Config struct {
- Count int // number of VMs to use
- Qemu string // qemu binary name (qemu-system-arch by default)
- Qemu_Args string // additional command line arguments for qemu binary
- Kernel string // kernel for injected boot (e.g. arch/x86/boot/bzImage)
- Cmdline string // kernel command line (can only be specified with kernel)
- Initrd string // linux initial ramdisk. (optional)
- CPU int // number of VM CPUs
- Mem int // amount of VM memory in MBs
+ Count int // number of VMs to use
+ Qemu string // qemu binary name (qemu-system-arch by default)
+ Qemu_Args string // additional command line arguments for qemu binary
+ Kernel string // kernel for injected boot (e.g. arch/x86/boot/bzImage)
+ Cmdline string // kernel command line (can only be specified with kernel)
+ Initrd string // linux initial ramdisk. (optional)
+ Image_Device string // qemu image device (hda by default)
+ CPU int // number of VM CPUs
+ Mem int // amount of VM memory in MBs
}
type Pool struct {
@@ -100,9 +101,10 @@ var archConfigs = map[string]archConfig{
func ctor(env *vmimpl.Env) (vmimpl.Pool, error) {
archConfig := archConfigs[env.OS+"/"+env.Arch]
cfg := &Config{
- Count: 1,
- Qemu: archConfig.Qemu,
- Qemu_Args: archConfig.QemuArgs,
+ Count: 1,
+ Image_Device: "hda",
+ Qemu: archConfig.Qemu,
+ Qemu_Args: archConfig.QemuArgs,
}
if err := config.LoadData(env.Config, cfg); err != nil {
return nil, fmt.Errorf("failed to parse qemu vm config: %v", err)
@@ -264,7 +266,7 @@ func (inst *instance) Boot() error {
)
} else {
args = append(args,
- "-hda", inst.image,
+ "-"+inst.cfg.Image_Device, inst.image,
"-snapshot",
)
}