forked from kata-containers/kata-containers
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathqemu_riscv64.go
More file actions
65 lines (49 loc) · 1.47 KB
/
qemu_riscv64.go
File metadata and controls
65 lines (49 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) 2024 Institute of Software, CAS.
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import (
"fmt"
"time"
govmmQemu "github.com/kata-containers/kata-containers/src/runtime/pkg/govmm/qemu"
)
type qemuRiscv64 struct {
// inherit from qemuArchBase, overwrite methods if needed
qemuArchBase
}
const defaultQemuPath = "/usr/bin/qemu-system-riscv64"
const defaultQemuMachineType = QemuVirt
const qmpMigrationWaitTimeout = 10 * time.Second
const defaultQemuMachineOptions = "accel=kvm,usb=off"
var kernelParams = []Param{
{"numa", "off"},
}
var supportedQemuMachine = govmmQemu.Machine{
Type: QemuVirt,
Options: defaultQemuMachineOptions,
}
func newQemuArch(config HypervisorConfig) (qemuArch, error) {
machineType := config.HypervisorMachineType
if machineType == "" {
machineType = defaultQemuMachineType
}
if machineType != defaultQemuMachineType {
return nil, fmt.Errorf("unrecognised machinetype: %v", machineType)
}
q := &qemuRiscv64{
qemuArchBase{
qemuMachine: supportedQemuMachine,
qemuExePath: defaultQemuPath,
memoryOffset: config.MemOffset,
kernelParamsNonDebug: kernelParamsNonDebug,
kernelParamsDebug: kernelParamsDebug,
kernelParams: kernelParams,
},
}
q.handleImagePath(config)
return q, nil
}
func (q *qemuRiscv64) appendIOMMU(devices []govmmQemu.Device) ([]govmmQemu.Device, error) {
return devices, fmt.Errorf("riscv64 does not support appending a vIOMMU")
}