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

libvirt: Add reasonable memory_backing_dir default for qemu. #105123

Closed
wants to merge 1 commit into from

Conversation

clefru
Copy link
Contributor

@clefru clefru commented Nov 27, 2020

When VMs are run with "",
qemu creates a backing file to make memory accessible to the guest and
other host processes. Without specifying memory_backing_dir, the
backing file actually lands on disk inside /var/lib/libvirt, which
makes every memory access inside the guest an actual filesystem IO.

This commit provides a reasonable default inside qemuVerbatimConfig.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

When VMs are run with "<memoryBacking><access mode='shared'/></memoryBacking>",
qemu creates a backing file to make memory accessible to the guest an
other host processes. Without specifying memory_backing_dir, the
backing file actually lands on disk inside /var/lib/libvirt, which
makes every memory access inside the guest and actual filesystem IO.

This commit provides a reasonable default inside qemuVerbatimConfig.
@clefru
Copy link
Contributor Author

clefru commented Feb 12, 2021

@fpletz @globin friendly ping for maintainers of libvirt.

@clefru
Copy link
Contributor Author

clefru commented May 13, 2021

Friendly ping.

@clefru
Copy link
Contributor Author

clefru commented Jun 14, 2021

@fpletz @globin friendly ping for maintainers of libvirt.

@teto
Copy link
Member

teto commented Jun 14, 2021

I would be wary of changing libvirt defaults since they have been chosen for a reason. Nevertheless the option looks like something most people want so I would move it to the example section of qemuVerbatimConfig.

@clefru
Copy link
Contributor Author

clefru commented Jun 30, 2021

I would be wary of changing libvirt defaults since they have been chosen for a reason. Nevertheless the option looks like something most people want so I would move it to the example section of qemuVerbatimConfig.

I don't find this default reasonable, because /dev/shm is exactly the right place for creating large backing files for shared memory. /var/lib/libvirt isn't, as this is nearly always going to land on disk.

But maybe I can get upstream to change it. I'll drop this PR, as going for upstream seems like a better use of time. Thank you for the feedback, Matthieu.

@clefru clefru closed this Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants