Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring a snapshot that uses virtio-mem backed by a file fails #6337

Closed
alex-matei opened this issue Mar 28, 2024 · 0 comments · Fixed by #6338
Closed

Restoring a snapshot that uses virtio-mem backed by a file fails #6337

alex-matei opened this issue Mar 28, 2024 · 0 comments · Fixed by #6338

Comments

@alex-matei
Copy link
Contributor

Describe the bug

The memory region that is associated with the hotpluggable part of a virtio-mem zone isn't backed by the file specified in the MemoryZoneConfig. The file is used only for the fixed part of the zone. When you try to restore a snapshot with virtio-mem, the backing file is used for all its regions. This results in the following error:

  Error restoring VM: VmRestore(MemoryManager(GuestMemoryRegion(MappingPastEof)))

To Reproduce

First terminal

truncate -s 512M /tmp/mem
cloud-hypervisor --serial tty --console off --kernel /opt/kata/share/kata-containers/vmlinux.container -v --cmdline "console=ttyS0,115200n8" --initramfs /opt/kata/share/kata-containers/kata-alpine-3.15.initrd --api-socket path=/tmp/test.sock --memory size=0,hotplug_method=virtio-mem  --memory-zone id=mem0,size=512M,file=/tmp/mem,shared=on,hotplug_size=1G

Second terminal

ch-remote --api-socket /tmp/test.sock pause
mkdir /tmp/template
ch-remote --api-socket /tmp/test.sock snapshot file:///tmp/template
killall cloud-hypervisor

First terminal

cloud-hypervisor --restore source_url=file:///tmp/template --api-socket path=/tmp/test.sock -v
alex-matei added a commit to UiPath/cloud-hypervisor that referenced this issue Mar 28, 2024
The memory region that is associated with the hotpluggable part of
a virtio-mem zone isn't backed by the file specified in the
MemoryZoneConfig. The file is used only for the fixed part of the
zone. When you try to restore a snapshot with virtio-mem, the
backing file is used for all its regions. This results in the
following error:

  VmRestore(MemoryManager(GuestMemoryRegion(MappingPastEof)))

This patch sets backing_file only for the fixed part of a virtio-mem
zone.

Fixes: cloud-hypervisor#6337

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
github-merge-queue bot pushed a commit that referenced this issue Mar 29, 2024
The memory region that is associated with the hotpluggable part of
a virtio-mem zone isn't backed by the file specified in the
MemoryZoneConfig. The file is used only for the fixed part of the
zone. When you try to restore a snapshot with virtio-mem, the
backing file is used for all its regions. This results in the
following error:

  VmRestore(MemoryManager(GuestMemoryRegion(MappingPastEof)))

This patch sets backing_file only for the fixed part of a virtio-mem
zone.

Fixes: #6337

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

1 participant