mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-22 13:38:26 +00:00
clh: Boot from persistent memory device
This patch enables clh to mount the guest rootfs on a pmem device while booting, which can reduce the guest memory footprint. Fixes: #2589 Depends-on: github.com/kata-containers/packaging#1014 Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
e8fc25a7f4
commit
7aa3168500
@ -127,7 +127,7 @@ type cloudHypervisor struct {
|
||||
|
||||
var clhKernelParams = []Param{
|
||||
|
||||
{"root", "/dev/vda1"},
|
||||
{"root", "/dev/pmem0p1"},
|
||||
{"panic", "1"}, // upon kernel panic wait 1 second before reboot
|
||||
{"no_timer_check", ""}, // do not check broken timer IRQ resources
|
||||
{"noreplace-smp", ""}, // do not replace SMP instructions
|
||||
@ -269,11 +269,17 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
|
||||
return errors.New("image path is empty")
|
||||
}
|
||||
|
||||
disk := chclient.DiskConfig{
|
||||
Path: imagePath,
|
||||
Readonly: true,
|
||||
st, err := os.Stat(imagePath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to get information for image file '%v': %v", imagePath, err)
|
||||
}
|
||||
clh.vmconfig.Disks = append(clh.vmconfig.Disks, disk)
|
||||
|
||||
pmem := chclient.PmemConfig{
|
||||
File: imagePath,
|
||||
Size: st.Size(),
|
||||
DiscardWrites: true,
|
||||
}
|
||||
clh.vmconfig.Pmem = append(clh.vmconfig.Pmem, pmem)
|
||||
|
||||
// set the serial console to the cloud hypervisor
|
||||
if clh.config.Debug {
|
||||
|
Loading…
Reference in New Issue
Block a user