Page MenuHomeFreeBSD

bhyve: [snapshot] increase SNAPSHOT_BUFFER_SIZE according with fbuf size
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Dec 28 2023, 1:00 AM.
Tags
Referenced Files
Unknown Object (File)
Oct 3 2024, 12:35 PM
Unknown Object (File)
Sep 30 2024, 2:02 PM
Unknown Object (File)
Sep 23 2024, 4:54 PM
Unknown Object (File)
Sep 17 2024, 11:50 AM
Unknown Object (File)
Sep 17 2024, 7:12 AM
Unknown Object (File)
Sep 17 2024, 12:05 AM
Unknown Object (File)
Aug 17 2024, 10:01 AM
Unknown Object (File)
Aug 11 2024, 4:17 AM

Details

Summary

VM suspend fails with "vm_snapshot_buf: buffer too small" error.

Sponsored by: vStack
Fixes: fb51ddb20d57 ("bhyve: increase fbuf display resolution limit")


GitHub commit:

https://github.com/gusev-vitaliy/freebsd/commit/e98d07412e70279ed0dc1bf712cd5192de9a85d6

Test Plan

Without patch:

Run Ubuntu VM with 1 vcpu (several vcpus still are broken).

~# bhyvectl --suspend=s1 --vm=ubuntu22

Console with running bhyve gets error:

[1024.000MiB / 1024.000MiB] |###############################################################################################################|
vm_snapshot_buf: buffer too small
vm_snapshot_buf_err: snapshot-save failed for fbuf_sc->fb_base
Failed to snapshot fbuf@pci.0.7.0; ret=7
Failed to snapshot device state.

With patch

Suspend and Resume work fine. In .meta file - data size of fbuf device is 32MB:

{
  "device": "fbuf@pci.0.7.0",
  "size": 33554884,
  "file_offset": 74431
},

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks good - thanks for the fix.

as a side thought, wondering if FB_SIZE and SNAPSHOT_BUFFER_SIZE should be computed on the fly at some point in the future.

This revision is now accepted and ready to land.Dec 28 2023, 9:18 AM
In D43218#985023, @rew wrote:

as a side thought, wondering if FB_SIZE and SNAPSHOT_BUFFER_SIZE should be computed on the fly at some point in the future.

I would like to implement all snapshot code via nvlist and all things above will be removed. Probably setting size to 40MB is enough for now.

This seems fine as a stopgap. If you mail me git patches for this and the MTRR review, I'll apply them.

This revision was automatically updated to reflect the committed changes.

This seems fine as a stopgap. If you mail me git patches for this and the MTRR review, I'll apply them.

I went ahead and took care of these, hopefully you don't mind.

This one fixes a bug introduced by me and then I committed the MTRR review since I was already in the area.

In D43218#985321, @rew wrote:

This seems fine as a stopgap. If you mail me git patches for this and the MTRR review, I'll apply them.

I went ahead and took care of these, hopefully you don't mind.

Not at all, thank you!