Skip to content

Implement OpenVMM backend - #41697

Open
Daman Mulye (damanm24) wants to merge 5 commits into
feature/openvmmfrom
user/damanmulye/openvmm-backend
Open

Daman Mulye (damanm24) wants to merge 5 commits into
feature/openvmmfrom
user/damanmulye/openvmm-backend

Conversation

@damanm24

Copy link
Copy Markdown
Contributor

This PR implements the rest of the IVirtualMachineBackend interface for the OpenVmmVirtualMachineBackend class. Specifically, it adds support for: filesystem shares and networking devices.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@damanm24
Daman Mulye (damanm24) requested a review from a team as a code owner September 24, 2026 18:21
Copilot AI lite review requested due to automatic review settings September 24, 2026 18:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Unresolved critical cancellation and VM-lifetime races, along with additional networking and validation issues, block approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity · 2 Medium severity · 1 Low severity

Open (5)
What changed in this PR

Implements the remaining IVirtualMachineBackend functionality for OpenVMM, including filesystem shares and networking.

Changes:

  • Adds filesystem share and device lifecycle management.
  • Adds network adapters, port binding, and guest connections.
  • Expands lifecycle, cancellation, and integration tests.
File Summary and findings
test/​windows/​OpenVmmVirtualMachineBackendTests.cpp Adds filesystem, networking, and cancellation tests. Nit (2 votes): bind coverage does not verify end-to-end traffic. Moderate (2 votes): cancellation test synchronization can race guest-accept startup.
src/​windows/​common/​OpenVmmVirtualMachineBackend.h Adds backend resource state and APIs.
src/​windows/​common/​OpenVmmVirtualMachineBackend.cpp Implements filesystem, networking, listener, and lifecycle operations. Critical (3 votes): cancellation remains permanently signaled. Critical (1 vote): m_vm access can race termination. Moderate (4 votes): out-of-range disk LUN validation is unreachable. Moderate (1 vote each): listener and client sockets require overlapped AF_UNIX creation; requested network configuration is not fully applied.
src/​windows/​common/​IVirtualMachineBackend.h Extends VM descriptions and backend request types.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp Outdated
Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp Outdated
Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp Outdated
Comment thread test/windows/OpenVmmVirtualMachineBackendTests.cpp Outdated
Comment thread test/windows/OpenVmmVirtualMachineBackendTests.cpp Outdated
Copilot AI review requested due to automatic review settings September 24, 2026 20:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Unresolved post-exit resource handling issues and incomplete or potentially flaky integration coverage remain.

Review effort: Lite
Findings: None

Resolved since last review (5)

Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp Outdated
Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp Outdated
Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp Outdated
Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp Outdated
Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp
Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp Outdated

std::filesystem::path GetVsockListenerPath(const std::filesystem::path& VsockPath, GuestServicePort Port)
{
return std::format(L"{}_{:08x}-facb-11e6-bd58-64006a7986d3", VsockPath.native(), Port.Value);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What's the context for this constant guid ? Is that an openvmm value ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah this comes from OpenVMM's hybrid_vsock implementation which bridges hvsocket and UDS. See: https://github.com/SvenGroot/openvmm/blob/main/support/hybrid_vsock/src/lib.rs. This GUID is an embedding of the AF_VSOCK port into an AF_HYPERV service ID.

Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp
THROW_WIN32_IF(
static_cast<DWORD>(WSAGetLastError()), connect(socket.get(), reinterpret_cast<const sockaddr*>(&address), sizeof(address)) == SOCKET_ERROR);

const auto request = std::format("CONNECT {}\n", Port.Value);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For my own knowledge, is this "CONNECT" request going to be interpreted by openvmm and then connect into the right hvsocket port on the guest, or is the expectation that we'll have a linux usermode process doing that for ourselves ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the former interpretation is correct. CONNECT is interpreted by OpenVMM and the hvsocket service ID which follows the CONNECT string contains the AF_VSOCK port number.

Copilot AI review requested due to automatic review settings September 25, 2026 23:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Moderate correctness, lifecycle, race, and test reliability issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

Comment thread src/windows/common/OpenVmmVirtualMachineBackend.cpp

This branch has not been deployed

No deployments
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.

3 participants