mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 22:53:43 +00:00
qemu: add disalbe_image_nvdimm option
To control whether an image rootfs is used as nvdimm device or just plain virtio-block device. Fixes: #2372 Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
dd5b446997
commit
a8717286ca
@ -205,6 +205,11 @@ enable_iothreads = @DEFENABLEIOTHREADS@
|
|||||||
# Default false
|
# Default false
|
||||||
#use_vsock = true
|
#use_vsock = true
|
||||||
|
|
||||||
|
# If false and nvdimm is supported, use nvdimm device to plug guest image.
|
||||||
|
# Otherwise virtio-block device is used.
|
||||||
|
# Default false
|
||||||
|
#disable_image_nvdimm = true
|
||||||
|
|
||||||
# VFIO devices are hotplugged on a bridge by default.
|
# VFIO devices are hotplugged on a bridge by default.
|
||||||
# Enable hotplugging on root bus. This may be required for devices with
|
# Enable hotplugging on root bus. This may be required for devices with
|
||||||
# a large PCI bar, as this is a current limitation with hotplugging on
|
# a large PCI bar, as this is a current limitation with hotplugging on
|
||||||
|
@ -206,6 +206,11 @@ enable_iothreads = @DEFENABLEIOTHREADS@
|
|||||||
# Default false
|
# Default false
|
||||||
#use_vsock = true
|
#use_vsock = true
|
||||||
|
|
||||||
|
# If false and nvdimm is supported, use nvdimm device to plug guest image.
|
||||||
|
# Otherwise virtio-block device is used.
|
||||||
|
# Default is false
|
||||||
|
#disable_image_nvdimm = true
|
||||||
|
|
||||||
# VFIO devices are hotplugged on a bridge by default.
|
# VFIO devices are hotplugged on a bridge by default.
|
||||||
# Enable hotplugging on root bus. This may be required for devices with
|
# Enable hotplugging on root bus. This may be required for devices with
|
||||||
# a large PCI bar, as this is a current limitation with hotplugging on
|
# a large PCI bar, as this is a current limitation with hotplugging on
|
||||||
|
@ -46,6 +46,7 @@ const defaultHotplugVFIOOnRootBus bool = false
|
|||||||
const defaultEntropySource = "/dev/urandom"
|
const defaultEntropySource = "/dev/urandom"
|
||||||
const defaultGuestHookPath string = ""
|
const defaultGuestHookPath string = ""
|
||||||
const defaultVirtioFSCacheMode = "none"
|
const defaultVirtioFSCacheMode = "none"
|
||||||
|
const defaultDisableImageNvdimm = false
|
||||||
|
|
||||||
const defaultTemplatePath string = "/run/vc/vm/template"
|
const defaultTemplatePath string = "/run/vc/vm/template"
|
||||||
const defaultVMCacheEndpoint string = "/var/run/kata-containers/cache.sock"
|
const defaultVMCacheEndpoint string = "/var/run/kata-containers/cache.sock"
|
||||||
|
@ -120,6 +120,7 @@ type hypervisor struct {
|
|||||||
DisableNestingChecks bool `toml:"disable_nesting_checks"`
|
DisableNestingChecks bool `toml:"disable_nesting_checks"`
|
||||||
EnableIOThreads bool `toml:"enable_iothreads"`
|
EnableIOThreads bool `toml:"enable_iothreads"`
|
||||||
UseVSock bool `toml:"use_vsock"`
|
UseVSock bool `toml:"use_vsock"`
|
||||||
|
DisableImageNvdimm bool `toml:"disable_image_nvdimm"`
|
||||||
HotplugVFIOOnRootBus bool `toml:"hotplug_vfio_on_root_bus"`
|
HotplugVFIOOnRootBus bool `toml:"hotplug_vfio_on_root_bus"`
|
||||||
DisableVhostNet bool `toml:"disable_vhost_net"`
|
DisableVhostNet bool `toml:"disable_vhost_net"`
|
||||||
GuestHookPath string `toml:"guest_hook_path"`
|
GuestHookPath string `toml:"guest_hook_path"`
|
||||||
@ -643,6 +644,7 @@ func newQemuHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
|
|||||||
EnableIOThreads: h.EnableIOThreads,
|
EnableIOThreads: h.EnableIOThreads,
|
||||||
Msize9p: h.msize9p(),
|
Msize9p: h.msize9p(),
|
||||||
UseVSock: useVSock,
|
UseVSock: useVSock,
|
||||||
|
DisableImageNvdimm: h.DisableImageNvdimm,
|
||||||
HotplugVFIOOnRootBus: h.HotplugVFIOOnRootBus,
|
HotplugVFIOOnRootBus: h.HotplugVFIOOnRootBus,
|
||||||
DisableVhostNet: h.DisableVhostNet,
|
DisableVhostNet: h.DisableVhostNet,
|
||||||
GuestHookPath: h.guestHookPath(),
|
GuestHookPath: h.guestHookPath(),
|
||||||
@ -1069,6 +1071,7 @@ func GetDefaultHypervisorConfig() vc.HypervisorConfig {
|
|||||||
HotplugVFIOOnRootBus: defaultHotplugVFIOOnRootBus,
|
HotplugVFIOOnRootBus: defaultHotplugVFIOOnRootBus,
|
||||||
GuestHookPath: defaultGuestHookPath,
|
GuestHookPath: defaultGuestHookPath,
|
||||||
VirtioFSCache: defaultVirtioFSCacheMode,
|
VirtioFSCache: defaultVirtioFSCacheMode,
|
||||||
|
DisableImageNvdimm: defaultDisableImageNvdimm,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +90,13 @@ var commonNvdimmKernelRootParams = []Param{ //nolint: unused, deadcode, varcheck
|
|||||||
{"rootfstype", "ext4"},
|
{"rootfstype", "ext4"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// agnostic list of kernel root parameters for NVDIMM
|
||||||
|
var commonNvdimmNoDAXKernelRootParams = []Param{ //nolint: unused, deadcode, varcheck
|
||||||
|
{"root", "/dev/pmem0p1"},
|
||||||
|
{"rootflags", "data=ordered,errors=remount-ro ro"},
|
||||||
|
{"rootfstype", "ext4"},
|
||||||
|
}
|
||||||
|
|
||||||
// agnostic list of kernel root parameters for virtio-blk
|
// agnostic list of kernel root parameters for virtio-blk
|
||||||
var commonVirtioblkKernelRootParams = []Param{ //nolint: unused, deadcode, varcheck
|
var commonVirtioblkKernelRootParams = []Param{ //nolint: unused, deadcode, varcheck
|
||||||
{"root", "/dev/vda1"},
|
{"root", "/dev/vda1"},
|
||||||
@ -352,6 +359,9 @@ type HypervisorConfig struct {
|
|||||||
// UseVSock use a vsock for agent communication
|
// UseVSock use a vsock for agent communication
|
||||||
UseVSock bool
|
UseVSock bool
|
||||||
|
|
||||||
|
// DisableImageNvdimm is used to disable guest rootfs image nvdimm devices
|
||||||
|
DisableImageNvdimm bool
|
||||||
|
|
||||||
// HotplugVFIOOnRootBus is used to indicate if devices need to be hotplugged on the
|
// HotplugVFIOOnRootBus is used to indicate if devices need to be hotplugged on the
|
||||||
// root bus instead of a bridge.
|
// root bus instead of a bridge.
|
||||||
HotplugVFIOOnRootBus bool
|
HotplugVFIOOnRootBus bool
|
||||||
|
@ -241,6 +241,7 @@ func (s *Sandbox) dumpConfig(ss *persistapi.SandboxState) {
|
|||||||
Mlock: sconfig.HypervisorConfig.Mlock,
|
Mlock: sconfig.HypervisorConfig.Mlock,
|
||||||
DisableNestingChecks: sconfig.HypervisorConfig.DisableNestingChecks,
|
DisableNestingChecks: sconfig.HypervisorConfig.DisableNestingChecks,
|
||||||
UseVSock: sconfig.HypervisorConfig.UseVSock,
|
UseVSock: sconfig.HypervisorConfig.UseVSock,
|
||||||
|
DisableImageNvdimm: sconfig.HypervisorConfig.DisableImageNvdimm,
|
||||||
HotplugVFIOOnRootBus: sconfig.HypervisorConfig.HotplugVFIOOnRootBus,
|
HotplugVFIOOnRootBus: sconfig.HypervisorConfig.HotplugVFIOOnRootBus,
|
||||||
BootToBeTemplate: sconfig.HypervisorConfig.BootToBeTemplate,
|
BootToBeTemplate: sconfig.HypervisorConfig.BootToBeTemplate,
|
||||||
BootFromTemplate: sconfig.HypervisorConfig.BootFromTemplate,
|
BootFromTemplate: sconfig.HypervisorConfig.BootFromTemplate,
|
||||||
@ -532,6 +533,7 @@ func loadSandboxConfig(id string) (*SandboxConfig, error) {
|
|||||||
Mlock: hconf.Mlock,
|
Mlock: hconf.Mlock,
|
||||||
DisableNestingChecks: hconf.DisableNestingChecks,
|
DisableNestingChecks: hconf.DisableNestingChecks,
|
||||||
UseVSock: hconf.UseVSock,
|
UseVSock: hconf.UseVSock,
|
||||||
|
DisableImageNvdimm: hconf.DisableImageNvdimm,
|
||||||
HotplugVFIOOnRootBus: hconf.HotplugVFIOOnRootBus,
|
HotplugVFIOOnRootBus: hconf.HotplugVFIOOnRootBus,
|
||||||
BootToBeTemplate: hconf.BootToBeTemplate,
|
BootToBeTemplate: hconf.BootToBeTemplate,
|
||||||
BootFromTemplate: hconf.BootFromTemplate,
|
BootFromTemplate: hconf.BootFromTemplate,
|
||||||
|
@ -142,6 +142,9 @@ type HypervisorConfig struct {
|
|||||||
// UseVSock use a vsock for agent communication
|
// UseVSock use a vsock for agent communication
|
||||||
UseVSock bool
|
UseVSock bool
|
||||||
|
|
||||||
|
// DisableImageNvdimm disables nvdimm for guest rootfs image
|
||||||
|
DisableImageNvdimm bool
|
||||||
|
|
||||||
// HotplugVFIOOnRootBus is used to indicate if devices need to be hotplugged on the
|
// HotplugVFIOOnRootBus is used to indicate if devices need to be hotplugged on the
|
||||||
// root bus instead of a bridge.
|
// root bus instead of a bridge.
|
||||||
HotplugVFIOOnRootBus bool
|
HotplugVFIOOnRootBus bool
|
||||||
|
@ -248,7 +248,7 @@ func (q *qemu) setup(id string, hypervisorConfig *HypervisorConfig, vcStore *sto
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if initrdPath == "" && imagePath != "" {
|
if initrdPath == "" && imagePath != "" && !q.config.DisableImageNvdimm {
|
||||||
q.nvdimmCount = 1
|
q.nvdimmCount = 1
|
||||||
} else {
|
} else {
|
||||||
q.nvdimmCount = 0
|
q.nvdimmCount = 0
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
package virtcontainers
|
package virtcontainers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/kata-containers/runtime/virtcontainers/types"
|
"github.com/kata-containers/runtime/virtcontainers/types"
|
||||||
@ -25,8 +24,6 @@ const defaultQemuPath = "/usr/bin/qemu-system-x86_64"
|
|||||||
|
|
||||||
const defaultQemuMachineType = QemuPC
|
const defaultQemuMachineType = QemuPC
|
||||||
|
|
||||||
const qemuNvdimmOption = "nvdimm"
|
|
||||||
|
|
||||||
const defaultQemuMachineOptions = "accel=kvm,kernel_irqchip"
|
const defaultQemuMachineOptions = "accel=kvm,kernel_irqchip"
|
||||||
|
|
||||||
const qmpMigrationWaitTimeout = 5 * time.Second
|
const qmpMigrationWaitTimeout = 5 * time.Second
|
||||||
@ -37,8 +34,6 @@ var qemuPaths = map[string]string{
|
|||||||
QemuQ35: defaultQemuPath,
|
QemuQ35: defaultQemuPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
var kernelRootParams = commonNvdimmKernelRootParams
|
|
||||||
|
|
||||||
var kernelParams = []Param{
|
var kernelParams = []Param{
|
||||||
{"tsc", "reliable"},
|
{"tsc", "reliable"},
|
||||||
{"no_timer_check", ""},
|
{"no_timer_check", ""},
|
||||||
@ -101,19 +96,12 @@ func newQemuArch(config HypervisorConfig) qemuArch {
|
|||||||
kernelParamsNonDebug: kernelParamsNonDebug,
|
kernelParamsNonDebug: kernelParamsNonDebug,
|
||||||
kernelParamsDebug: kernelParamsDebug,
|
kernelParamsDebug: kernelParamsDebug,
|
||||||
kernelParams: kernelParams,
|
kernelParams: kernelParams,
|
||||||
|
disableNvdimm: config.DisableImageNvdimm,
|
||||||
|
dax: true,
|
||||||
},
|
},
|
||||||
vmFactory: factory,
|
vmFactory: factory,
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.ImagePath != "" {
|
|
||||||
for i := range q.supportedQemuMachines {
|
|
||||||
q.supportedQemuMachines[i].Options = strings.Join([]string{
|
|
||||||
q.supportedQemuMachines[i].Options,
|
|
||||||
qemuNvdimmOption,
|
|
||||||
}, ",")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
q.handleImagePath(config)
|
q.handleImagePath(config)
|
||||||
|
|
||||||
return q
|
return q
|
||||||
@ -158,7 +146,10 @@ func (q *qemuAmd64) memoryTopology(memoryMb, hostMemoryMb uint64, slots uint8) g
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (q *qemuAmd64) appendImage(devices []govmmQemu.Device, path string) ([]govmmQemu.Device, error) {
|
func (q *qemuAmd64) appendImage(devices []govmmQemu.Device, path string) ([]govmmQemu.Device, error) {
|
||||||
return q.appendNvdimmImage(devices, path)
|
if !q.disableNvdimm {
|
||||||
|
return q.appendNvdimmImage(devices, path)
|
||||||
|
}
|
||||||
|
return q.appendBlockImage(devices, path)
|
||||||
}
|
}
|
||||||
|
|
||||||
// appendBridges appends to devices the given bridges
|
// appendBridges appends to devices the given bridges
|
||||||
|
@ -114,7 +114,6 @@ func TestQemuAmd64MemoryTopology(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestQemuAmd64AppendImage(t *testing.T) {
|
func TestQemuAmd64AppendImage(t *testing.T) {
|
||||||
var devices []govmmQemu.Device
|
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
f, err := ioutil.TempFile("", "img")
|
f, err := ioutil.TempFile("", "img")
|
||||||
@ -131,6 +130,7 @@ func TestQemuAmd64AppendImage(t *testing.T) {
|
|||||||
|
|
||||||
cfg := qemuConfig(QemuPC)
|
cfg := qemuConfig(QemuPC)
|
||||||
cfg.ImagePath = f.Name()
|
cfg.ImagePath = f.Name()
|
||||||
|
cfg.DisableImageNvdimm = false
|
||||||
amd64 := newQemuArch(cfg)
|
amd64 := newQemuArch(cfg)
|
||||||
for _, m := range amd64.(*qemuAmd64).supportedQemuMachines {
|
for _, m := range amd64.(*qemuAmd64).supportedQemuMachines {
|
||||||
assert.Contains(m.Options, qemuNvdimmOption)
|
assert.Contains(m.Options, qemuNvdimmOption)
|
||||||
@ -147,12 +147,33 @@ func TestQemuAmd64AppendImage(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
devices, err = amd64.appendImage(devices, f.Name())
|
devices, err := amd64.appendImage(nil, f.Name())
|
||||||
assert.NoError(err)
|
assert.NoError(err)
|
||||||
assert.Equal(expectedOut, devices)
|
assert.Equal(expectedOut, devices)
|
||||||
|
|
||||||
// restore default supportedQemuMachines options
|
// restore default supportedQemuMachines options
|
||||||
assert.Equal(len(supportedQemuMachines), copy(supportedQemuMachines, machinesCopy))
|
assert.Equal(len(supportedQemuMachines), copy(supportedQemuMachines, machinesCopy))
|
||||||
|
|
||||||
|
cfg.DisableImageNvdimm = true
|
||||||
|
amd64 = newQemuArch(cfg)
|
||||||
|
for _, m := range amd64.(*qemuAmd64).supportedQemuMachines {
|
||||||
|
assert.NotContains(m.Options, qemuNvdimmOption)
|
||||||
|
}
|
||||||
|
|
||||||
|
found := false
|
||||||
|
devices, err = amd64.appendImage(nil, f.Name())
|
||||||
|
assert.NoError(err)
|
||||||
|
for _, d := range devices {
|
||||||
|
if b, ok := d.(govmmQemu.BlockDevice); ok {
|
||||||
|
assert.Equal(b.Driver, govmmQemu.VirtioBlock)
|
||||||
|
assert.True(b.ShareRW)
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert.True(found)
|
||||||
|
|
||||||
|
// restore default supportedQemuMachines options
|
||||||
|
assert.Equal(len(supportedQemuMachines), copy(supportedQemuMachines, machinesCopy))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestQemuAmd64AppendBridges(t *testing.T) {
|
func TestQemuAmd64AppendBridges(t *testing.T) {
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
govmmQemu "github.com/intel/govmm/qemu"
|
govmmQemu "github.com/intel/govmm/qemu"
|
||||||
|
|
||||||
@ -133,6 +134,8 @@ type qemuArchBase struct {
|
|||||||
memoryOffset uint32
|
memoryOffset uint32
|
||||||
nestedRun bool
|
nestedRun bool
|
||||||
vhost bool
|
vhost bool
|
||||||
|
disableNvdimm bool
|
||||||
|
dax bool
|
||||||
networkIndex int
|
networkIndex int
|
||||||
qemuPaths map[string]string
|
qemuPaths map[string]string
|
||||||
supportedQemuMachines []govmmQemu.Machine
|
supportedQemuMachines []govmmQemu.Machine
|
||||||
@ -178,6 +181,8 @@ const (
|
|||||||
QemuCCWVirtio = "s390-ccw-virtio"
|
QemuCCWVirtio = "s390-ccw-virtio"
|
||||||
|
|
||||||
qmpCapMigrationIgnoreShared = "x-ignore-shared"
|
qmpCapMigrationIgnoreShared = "x-ignore-shared"
|
||||||
|
|
||||||
|
qemuNvdimmOption = "nvdimm"
|
||||||
)
|
)
|
||||||
|
|
||||||
// kernelParamsNonDebug is a list of the default kernel
|
// kernelParamsNonDebug is a list of the default kernel
|
||||||
@ -660,6 +665,20 @@ func (q *qemuArchBase) appendRNGDevice(devices []govmmQemu.Device, rngDev config
|
|||||||
|
|
||||||
func (q *qemuArchBase) handleImagePath(config HypervisorConfig) {
|
func (q *qemuArchBase) handleImagePath(config HypervisorConfig) {
|
||||||
if config.ImagePath != "" {
|
if config.ImagePath != "" {
|
||||||
|
kernelRootParams := commonVirtioblkKernelRootParams
|
||||||
|
if !q.disableNvdimm {
|
||||||
|
for i := range q.supportedQemuMachines {
|
||||||
|
q.supportedQemuMachines[i].Options = strings.Join([]string{
|
||||||
|
q.supportedQemuMachines[i].Options,
|
||||||
|
qemuNvdimmOption,
|
||||||
|
}, ",")
|
||||||
|
}
|
||||||
|
if q.dax {
|
||||||
|
kernelRootParams = commonNvdimmKernelRootParams
|
||||||
|
} else {
|
||||||
|
kernelRootParams = commonNvdimmNoDAXKernelRootParams
|
||||||
|
}
|
||||||
|
}
|
||||||
q.kernelParams = append(q.kernelParams, kernelRootParams...)
|
q.kernelParams = append(q.kernelParams, kernelRootParams...)
|
||||||
q.kernelParamsNonDebug = append(q.kernelParamsNonDebug, kernelParamsSystemdNonDebug...)
|
q.kernelParamsNonDebug = append(q.kernelParamsNonDebug, kernelParamsSystemdNonDebug...)
|
||||||
q.kernelParamsDebug = append(q.kernelParamsDebug, kernelParamsSystemdDebug...)
|
q.kernelParamsDebug = append(q.kernelParamsDebug, kernelParamsSystemdDebug...)
|
||||||
|
@ -25,8 +25,6 @@ const defaultQemuPath = "/usr/bin/qemu-system-aarch64"
|
|||||||
|
|
||||||
const defaultQemuMachineType = QemuVirt
|
const defaultQemuMachineType = QemuVirt
|
||||||
|
|
||||||
const qemuNvdimmOption = "nvdimm"
|
|
||||||
|
|
||||||
const qmpMigrationWaitTimeout = 10 * time.Second
|
const qmpMigrationWaitTimeout = 10 * time.Second
|
||||||
|
|
||||||
var defaultQemuMachineOptions = "usb=off,accel=kvm,gic-version=" + getGuestGICVersion()
|
var defaultQemuMachineOptions = "usb=off,accel=kvm,gic-version=" + getGuestGICVersion()
|
||||||
@ -41,15 +39,6 @@ var kernelParams = []Param{
|
|||||||
{"iommu.passthrough", "0"},
|
{"iommu.passthrough", "0"},
|
||||||
}
|
}
|
||||||
|
|
||||||
// For now, AArch64 doesn't support DAX, so we couldn't use
|
|
||||||
// commonNvdimmKernelRootParams, the agnostic list of kernel
|
|
||||||
// root parameters for NVDIMM
|
|
||||||
var kernelRootParams = []Param{
|
|
||||||
{"root", "/dev/pmem0p1"},
|
|
||||||
{"rootflags", "data=ordered,errors=remount-ro ro"},
|
|
||||||
{"rootfstype", "ext4"},
|
|
||||||
}
|
|
||||||
|
|
||||||
var supportedQemuMachines = []govmmQemu.Machine{
|
var supportedQemuMachines = []govmmQemu.Machine{
|
||||||
{
|
{
|
||||||
Type: QemuVirt,
|
Type: QemuVirt,
|
||||||
@ -150,20 +139,11 @@ func newQemuArch(config HypervisorConfig) qemuArch {
|
|||||||
kernelParamsNonDebug: kernelParamsNonDebug,
|
kernelParamsNonDebug: kernelParamsNonDebug,
|
||||||
kernelParamsDebug: kernelParamsDebug,
|
kernelParamsDebug: kernelParamsDebug,
|
||||||
kernelParams: kernelParams,
|
kernelParams: kernelParams,
|
||||||
|
disableNvdimm: config.DisableImageNvdimm,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.ImagePath != "" {
|
q.handleImagePath(config)
|
||||||
for i := range q.supportedQemuMachines {
|
|
||||||
q.supportedQemuMachines[i].Options = strings.Join([]string{
|
|
||||||
q.supportedQemuMachines[i].Options,
|
|
||||||
qemuNvdimmOption,
|
|
||||||
}, ",")
|
|
||||||
}
|
|
||||||
q.kernelParams = append(q.kernelParams, kernelRootParams...)
|
|
||||||
q.kernelParamsNonDebug = append(q.kernelParamsNonDebug, kernelParamsSystemdNonDebug...)
|
|
||||||
q.kernelParamsDebug = append(q.kernelParamsDebug, kernelParamsSystemdDebug...)
|
|
||||||
}
|
|
||||||
|
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
@ -178,7 +158,10 @@ func (q *qemuArm64) appendBridges(devices []govmmQemu.Device) []govmmQemu.Device
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (q *qemuArm64) appendImage(devices []govmmQemu.Device, path string) ([]govmmQemu.Device, error) {
|
func (q *qemuArm64) appendImage(devices []govmmQemu.Device, path string) ([]govmmQemu.Device, error) {
|
||||||
return q.appendNvdimmImage(devices, path)
|
if !q.disableNvdimm {
|
||||||
|
return q.appendNvdimmImage(devices, path)
|
||||||
|
}
|
||||||
|
return q.appendBlockImage(devices, path)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *qemuArm64) setIgnoreSharedMemoryMigrationCaps(_ context.Context, _ *govmmQemu.QMP) error {
|
func (q *qemuArm64) setIgnoreSharedMemoryMigrationCaps(_ context.Context, _ *govmmQemu.QMP) error {
|
||||||
|
@ -32,8 +32,6 @@ var qemuPaths = map[string]string{
|
|||||||
QemuPseries: defaultQemuPath,
|
QemuPseries: defaultQemuPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
var kernelRootParams = []Param{}
|
|
||||||
|
|
||||||
var kernelParams = []Param{
|
var kernelParams = []Param{
|
||||||
{"tsc", "reliable"},
|
{"tsc", "reliable"},
|
||||||
{"no_timer_check", ""},
|
{"no_timer_check", ""},
|
||||||
|
@ -38,8 +38,6 @@ var kernelParams = []Param{
|
|||||||
{"console", "ttysclp0"},
|
{"console", "ttysclp0"},
|
||||||
}
|
}
|
||||||
|
|
||||||
var kernelRootParams = commonVirtioblkKernelRootParams
|
|
||||||
|
|
||||||
var ccwbridge = types.NewBridge(types.CCW, "", make(map[uint32]string, types.CCWBridgeMaxCapacity), 0)
|
var ccwbridge = types.NewBridge(types.CCW, "", make(map[uint32]string, types.CCWBridgeMaxCapacity), 0)
|
||||||
|
|
||||||
var supportedQemuMachines = []govmmQemu.Machine{
|
var supportedQemuMachines = []govmmQemu.Machine{
|
||||||
@ -78,7 +76,7 @@ func newQemuArch(config HypervisorConfig) qemuArch {
|
|||||||
q.Bridges = append(q.Bridges, ccwbridge)
|
q.Bridges = append(q.Bridges, ccwbridge)
|
||||||
|
|
||||||
if config.ImagePath != "" {
|
if config.ImagePath != "" {
|
||||||
q.kernelParams = append(q.kernelParams, kernelRootParams...)
|
q.kernelParams = append(q.kernelParams, commonVirtioblkKernelRootParams...)
|
||||||
q.kernelParamsNonDebug = append(q.kernelParamsNonDebug, kernelParamsSystemdNonDebug...)
|
q.kernelParamsNonDebug = append(q.kernelParamsNonDebug, kernelParamsSystemdNonDebug...)
|
||||||
q.kernelParamsDebug = append(q.kernelParamsDebug, kernelParamsSystemdDebug...)
|
q.kernelParamsDebug = append(q.kernelParamsDebug, kernelParamsSystemdDebug...)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user