Skip to content

Conversation

@aesteve-rh
Copy link
Contributor

@aesteve-rh aesteve-rh commented Dec 11, 2025

Add support for GET_SHMEM_CONFIG message to retrieve VirtIO Shared Memory Regions configuration.

This is useful when the frontend is unaware of specific backend type and configuration of the memory layout.

Based on the patch [1] which is just waiting for being merged.

[1] -
https://lore.kernel.org/all/[email protected]/

Summary of the PR

Please summarize here why the changes in this PR are needed.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

@aesteve-rh
Copy link
Contributor Author

cc @mtjhrc @dorindabassey

Add support for GET_SHMEM_CONFIG message to retrieve
VirtIO Shared Memory Regions configuration.

This is useful when the frontend is unaware of specific
backend type and configuration of the memory layout.

Based on the patch [1] which is just waiting for being
merged.

[1] -
https://lore.kernel.org/all/[email protected]/

Signed-off-by: Albert Esteve <[email protected]>
/// Padding for correct alignment
padding: u32,
/// Size of each memory region
pub memory_sizes: [u64; 8],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the spec is a bit ambiguous and i don't see a QEMU implementation yet, but it sounds like this is supposed to be variable length in the wire protocol. you could of course choose to only support 8 in this library, but then i think you still need to adjust the code to read/write these values from the socket correctly + error or something in VhostUserShMemConfig::new if nregions is too big

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants