aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorSiddharth M <siddharth.muralee@gmail.com>2019-02-22 17:48:44 +0530
committerDmitry Vyukov <dvyukov@google.com>2019-02-22 13:18:44 +0100
commit7fa29a58950476516166f4cd66d66036fb182be2 (patch)
tree2f4fda0db863bb05c5f7c5f64414f83cf2508f79 /vm
parent6a5fcca423a42e14346de8637cc30d79530bf034 (diff)
pkg/build: added feature to copy kernel image for netbsd
* Modified pkg/build/netbsd.go 1. Made kernel build incremental 2. Added code to copy kernel to disk image * Fix formating issues * Fixed basic issues * Fixed copy kernel to disk 1. Added CPU option to default 2. Added snapshot option to vm/qemu/qemu.go 3. Hacky solution to get the build working * Fixed issues and added vm.MonitorExecution * Added sync instead of poweroff
Diffstat (limited to 'vm')
-rw-r--r--vm/qemu/qemu.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go
index 2e36edc07..65dce6764 100644
--- a/vm/qemu/qemu.go
+++ b/vm/qemu/qemu.go
@@ -37,6 +37,7 @@ type Config struct {
ImageDevice string `json:"image_device"` // qemu image device (hda by default)
CPU int `json:"cpu"` // number of VM CPUs
Mem int `json:"mem"` // amount of VM memory in MBs
+ Snapshot bool `json:"snapshot"` // For building kernels without -snapshot (for pkg/build)
}
type Pool struct {
@@ -181,9 +182,11 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) {
archConfig := archConfigs[env.OS+"/"+env.Arch]
cfg := &Config{
Count: 1,
+ CPU: 1,
ImageDevice: "hda",
Qemu: archConfig.Qemu,
QemuArgs: archConfig.QemuArgs,
+ Snapshot: true,
}
if err := config.LoadData(env.Config, cfg); err != nil {
return nil, fmt.Errorf("failed to parse qemu vm config: %v", err)
@@ -336,8 +339,10 @@ func (inst *instance) Boot() error {
} else if inst.image != "" {
args = append(args,
"-"+inst.cfg.ImageDevice, inst.image,
- "-snapshot",
)
+ if inst.cfg.Snapshot {
+ args = append(args, "-snapshot")
+ }
}
if inst.cfg.Initrd != "" {
args = append(args,