Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
331 commits
Select commit Hold shift + click to select a range
bac95b9
[hyperv-hcs] move plan9 shares formatting to its own source
xmkg May 7, 2025
4981e78
[hyperv-hcs] move CreateComputeSystemParams formatting to src/
xmkg May 7, 2025
4c122bb
[hyperv-hcs-hcn] replace fmt::format("{}", v) with fmt::to_string
xmkg May 7, 2025
0024e79
[hyperv-api-utils] introduce out_ptr type
xmkg May 9, 2025
ed97426
[hyperv-util] gate void** operator to P != void
xmkg May 9, 2025
b41184c
[hyperv-hcn] use out_ptr where appropriate
xmkg May 9, 2025
a49d898
[out_ptr] switch to P1132 reference implementation
xmkg May 9, 2025
550d0b2
[hyperv-hcs] introduce modify_compute_system API and HcsRequest
xmkg May 14, 2025
add7e9d
[hyperv-hcs] replace add/remove_network_adapter with modify_cs
xmkg May 14, 2025
b2a65cd
[hyperv-hcs] replace resize_memory with modify_compute_system
xmkg May 15, 2025
e663d40
[lint] make the linter happy
xmkg May 15, 2025
503c222
[hyperv-hcs] replace 9p API functions with modify_compute_system
xmkg May 16, 2025
15cd003
[hyperv-hcs] remove update_cpu_count function
xmkg May 16, 2025
ae75840
[hyperv-hcs] introduce HcsPath type
xmkg May 28, 2025
c38b456
[platform/win] rewrite get_username using native Win32 API
xmkg May 28, 2025
ce6a797
[smb_mount] use Win32 API for folder permission checks
xmkg May 30, 2025
43ce4c6
[hyperv-hcs] use smb mount handler as native mount handler
xmkg May 30, 2025
182afed
[hyperv-hcs-vm] implement add_network_interface function
xmkg Jun 12, 2025
9a9707b
[platform/win] prevent clang-format messing with the include order
xmkg Jun 12, 2025
82c7b46
[hyperv-hcs-hcn] format code with the latest rule changes #2
xmkg Jun 12, 2025
f670e4c
[tests/hyperv_api] remove commented out obsolete code block
xmkg Jul 9, 2025
e76ad4e
[hyperv_api] constexpr -> constexpr static to make msvc 19 happy
xmkg Jul 16, 2025
d40b3de
[hyperv-hcs] add error message lookup to result code format output
xmkg Jul 18, 2025
291cd81
[hyperv-hcs] add an optional hint to the result code format output
xmkg Jul 18, 2025
463632c
[hyperv-hcs] replace header guards with `#pragma once`
xmkg Jul 18, 2025
7edd054
[hyperv-hcs] make the linter happy
xmkg Jul 16, 2025
25ee01a
[hyper-v] add missing formatters for the api table members
xmkg Jul 18, 2025
2a4cd14
[hyperv-hcs] small touch-ups to perform_[hcn|hcs]_operation
xmkg Jul 18, 2025
646e1e8
[hyperv-hcs] implement get_os_supported_schema_version() function
xmkg Jul 18, 2025
8613561
[hyperv-hcs] move get_os_supported_schema_version to schema version src
xmkg Jul 18, 2025
45a0114
[hyperv-hcs] move get_os_supported_schema_version to singleton class
xmkg Jul 18, 2025
66b2052
[hyperv-hcs] vm json: only add "services" section if version >= 2.5
xmkg Jul 18, 2025
b6a57ff
[hyperv-hcs] better handling of leading comma in ver dependent sections
xmkg Jul 18, 2025
5090bf7
[hyperv-hcs] update hcs/hcn ut expect_log calls to reflect changes
xmkg Jul 18, 2025
e2426b2
[hyperv-hcs] mock SchemaUtils in hcs unit tests
xmkg Jul 18, 2025
dd5079e
[hyperv-hcs] remove terminate return msg expect on hcs intg. tests
xmkg Jul 18, 2025
c6a4c42
[hyperv-hcs] format the code to make the linter happy
xmkg Jul 18, 2025
133d99e
[virtdisk] implement list_virtual_disk_chain function
xmkg Jul 25, 2025
86bc58f
[hyperv-hcs] grant vm access to all disks in the vhdx chain
xmkg Jul 25, 2025
3208c1f
[hyperv-hcs] implement set_compute_system_callback function
xmkg Jul 25, 2025
1a2ca7d
[hyperv-hcs] convert hcs api from name to handle based
xmkg Jul 25, 2025
5654dfc
[signal] reset signaled state after wait
xmkg Jul 25, 2025
43bbc13
[hyperv-hcs] add shutdown signal wait to shutdown code
xmkg Jul 25, 2025
67956b2
[hyperv-hcs] replace shutdown signal with state poll
xmkg Jul 25, 2025
e4bd2dc
[hyperv-hcs] shutdown: do the state poll wait only for non-gcs shutdown
xmkg Jul 26, 2025
4d3cacb
[hyperv-hcs] resize_memory: disable runtime memory resizing
xmkg Jul 26, 2025
83b7d96
[hyperv-hcs] call set_compute_system_callbacks in maybe_create_comput…
xmkg Jul 26, 2025
c421f07
[hyperv-hcs] fix resize_memory, resize_disk and update_cpus
xmkg Jul 26, 2025
98f1c64
[hyperv-hcs] fix linter errors
xmkg Jul 26, 2025
159220a
[hyperv-hcs] snapshot: fix head disk reparent/merge logic on erase
xmkg Jul 26, 2025
7b0b15f
[hyperv-hcs] fix host compute system api wrapper unit tests
xmkg Aug 14, 2025
97266f5
[hyperv-virtdisk] fix virtdisk wrapper unit tests
xmkg Aug 14, 2025
40745a4
[platform/win] fix linter error
xmkg Aug 14, 2025
a937665
[hyperv/virtdisk] use std::filesystem::equivalent for path comparison
xmkg Aug 15, 2025
55cf4f1
[hyperv-virtdisk] Disable list_parents test
xmkg Sep 10, 2025
42009aa
[tests/hyperv] Add mock hyperv hcs wrapper
xmkg Sep 12, 2025
9186f5b
[tests/hyperv] Add mock hyperv hcn wrapper
xmkg Sep 12, 2025
3b1b975
[tests/hyperv] Add mock hyperv virtdisk wrapper
xmkg Sep 12, 2025
65a5983
[tests/hyperv] Add boilerplate for VM unit tests
xmkg Sep 12, 2025
81e16b2
[hyperv-vm] Respect previous VM state on start
xmkg Sep 16, 2025
6735ade
[hyperv-hcs] Poll the state while waiting for shutdown
xmkg Sep 16, 2025
d2caa40
[hyperv-hcs] Add eq operator to HcsRequestType and HcsResourcePath
xmkg Sep 16, 2025
ecaf7e2
[hyperv-hcs] consider "stopped" state as not running too
xmkg Sep 16, 2025
00e14d9
[hyperv-hcs] remove "final" from the VM class
xmkg Sep 16, 2025
6e99a92
[hyperv-hcs] ssh-hostname: provide default for timeout
xmkg Sep 16, 2025
48b1c93
[tests/hyperv] Add remaining virtual machine unit tests
xmkg Sep 16, 2025
5fedf96
[hyperv-hcs] Add two more eq operators
xmkg Sep 16, 2025
bb94fbd
[tests/hyperv] Add unit tests for hcs_virtual_machine_factory
xmkg Sep 16, 2025
47a092c
[tests-virtdisk-it] Re-enable list_parents
xmkg Sep 16, 2025
2ed1f12
[platform/win] List IEEE 802.11 devices in get_network_interfaces_info
xmkg Sep 16, 2025
2713c1b
[cmake-deps] Fix typo
xmkg Oct 3, 2025
687dbb7
[hyperv-hcn] Use front() and back()
xmkg Oct 3, 2025
569feca
[hyperv-api] Be consistent in [[nodiscard]] use
xmkg Oct 3, 2025
b7e3a69
[hyperv-hcs] Remove `struct` keyword from hints to not to confuse cla…
xmkg Oct 3, 2025
c4221cd
[hyperv-api] Fix build after C++20 upgrade
xmkg Oct 10, 2025
6897e50
[hyperv-api] Make linter happy again
xmkg Oct 10, 2025
1cb1f63
[hyperv-hcs] Remove require_snapshot_support
xmkg Oct 17, 2025
78ee556
[base-virt-machine] Use ranges for view_snapshots
xmkg Oct 17, 2025
312b435
[test-base-virt-machine] Add predicate test for view_snapshots
xmkg Oct 17, 2025
d797b85
[hyperv-hcs] Address review comments, 1
xmkg Oct 17, 2025
b8fc5ac
[cmake] Move src/cmake to top level
xmkg Oct 17, 2025
0908c44
[cmake/cmake-deps] Add C++23 removal comment for out_ptr
xmkg Oct 17, 2025
446da86
[hyperv-api] Remove const from result members
xmkg Oct 17, 2025
3b10cb0
[platform_win] Move header to src/platform
xmkg Oct 17, 2025
f592404
[hyperv-api] Wrap api table refs with std::reference_wrapper
xmkg Oct 17, 2025
b36b266
[hyperv-hcn] Make wrapper constr/assign fns protected
xmkg Oct 17, 2025
fdb47b8
[hyperv-hcs] Make wrapper if constr/assign fns protected
xmkg Oct 17, 2025
d79c3fa
[hyperv-api] Switch back to const api table
xmkg Oct 17, 2025
54248df
[hyperv-hcs] Inherit from formatter<string_view> in all formatters
xmkg Oct 17, 2025
c07a412
[fileops] Remove noexcept overload of rename
xmkg Oct 17, 2025
a4ce1c1
[hyperv-hcs-vm] Add a warning if bridge creation fails
xmkg Oct 17, 2025
1aa628c
[hyperv-hcs] Make the linter happy again
xmkg Oct 17, 2025
372cc24
[virtual-machine] Add assert to default fmt case
xmkg Oct 30, 2025
7fb84aa
[virtual-machine] Add a TODO to replace State
xmkg Oct 30, 2025
8314d2a
[file-ops] Deprecate std::error_code overloads
xmkg Oct 30, 2025
9996a37
[hyperv-api-table] Remove comment
xmkg Oct 30, 2025
bc55899
[hyperv-hcs] Rename "bridge" to "vswitch"
xmkg Oct 30, 2025
13e43f1
[hv-string-conv] Mark as() decl as deleted
xmkg Oct 30, 2025
dadc77e
[hyperv-api] Fix build after changes
xmkg Nov 18, 2025
2e6e57a
[hyperv-hcn] Extract endpoint json rendering
xmkg Nov 18, 2025
f2805ae
[hyperv-hcn] Extract network params json rendering
xmkg Nov 18, 2025
5443ccd
[hyperv-hcn] Fix some of the review comments
xmkg Nov 18, 2025
fd48ec2
[file-ops] Comment out deprecations
xmkg Nov 18, 2025
3cd2753
[hyperv-hcs] Move HCS api table to Singleton
xmkg Nov 18, 2025
5701936
[virtual-machine] Fix linter warning
xmkg Nov 18, 2025
08cdffd
[hyperv-hcs] Move HCS wrapper to Singleton
xmkg Nov 19, 2025
a86dbcd
[hyperv-hcn] Move HCN API table to Singleton
xmkg Nov 19, 2025
f4843aa
[hyperv-hcn] Move HCN wrapper to Singleton
xmkg Nov 19, 2025
a4dde4d
[hyperv-api] Drop _api from hcs/hcn wrapper naming
xmkg Nov 19, 2025
e4f7ac8
[hyperv-api] Make the linter happy
xmkg Nov 19, 2025
5584211
[hyperv-virtdisk] Move VirtDisk API table to Singleton
xmkg Nov 21, 2025
eb1d0c9
[hyperv-virtdisk] Drop _api from virtdisk_api_wrapper
xmkg Nov 21, 2025
a49da3e
[hyperv-virtdisk] Move VirtDisk wrapper to Singleton
xmkg Nov 21, 2025
3eac803
[hyperv-api] Remove redundant fwdecl header
xmkg Nov 21, 2025
e4b6583
[hyperv-hcn] Add desc for HcnIpam
xmkg Nov 21, 2025
95affe3
[hyperv-hcn] Quote mac address in JSON
xmkg Nov 21, 2025
436c771
[hyperv-hcn] Do not quote null mac addr
xmkg Nov 24, 2025
1aadf1e
[hyperv-hcs] Update code after vm consolidation
xmkg Dec 9, 2025
019e971
[base-virtual-machine] Try to make gcc-11 happy
xmkg Dec 9, 2025
9b7936c
[hyperv-hcs] Add missing initializer
xmkg Dec 9, 2025
2bb4f62
[hyoerv-hcs] Apply couple of review suggestions
xmkg Dec 9, 2025
ce15cdc
[hyperv-hcs] fwdecl HCS_EVENT for parse_event
xmkg Dec 9, 2025
d6f0137
[hyperv-api] Remove typename from FormatContext::iterator
xmkg Dec 9, 2025
86fe341
[hyperv-hcs] Use static_bimap for enum<->str translation
xmkg Dec 9, 2025
b03b628
[hyperv-api] Remove function comments
xmkg Dec 9, 2025
7d7a087
[hyperv-hcs] Remove more comments, drive-by lint fixes
xmkg Dec 9, 2025
2f48e50
[hyperv-api] Remove redundant static from constexpr
xmkg Dec 9, 2025
cd8b72b
[hyperv-api] Replace auto with type
xmkg Dec 9, 2025
3c9568a
[hyperv-hcs] Switch cpu count and mem order in formatting
xmkg Dec 9, 2025
111e731
[hyperv-hcs] Simplify schema version code a bit
xmkg Dec 9, 2025
1bb5ba0
[hyperv-api] Remove _table suffix from API decls
xmkg Dec 9, 2025
7d71965
[hyperv-api] Rename append_version_dependent_section to append_if_sup…
xmkg Dec 9, 2025
de5e508
[clang-format] Assign priorities for windows.h and virtdisk.h
xmkg Dec 9, 2025
a13c6cf
[clang-format] Also prioritize initguid.h
xmkg Dec 9, 2025
e41390c
[static-bimap] Apply review suggestions
xmkg Dec 18, 2025
da57ce0
[platform-win] Apply review suggestions
xmkg Dec 18, 2025
096130d
[platform-win] Rename IEEE 802.11 to WiFi
xmkg Dec 18, 2025
535d6d7
[hyperv-hcn] Reflow some comments
xmkg Dec 18, 2025
2864334
[virtdisk] Describe source and parent path behavior
xmkg Dec 18, 2025
1127355
[virtdisk] Simplify exception inheritance
xmkg Dec 18, 2025
5ec0e0b
[virtdisk-snapshot] Apply some review suggestions
xmkg Dec 18, 2025
54e461f
[virtdisk-snapshot] Add an error msg for remove failure
xmkg Dec 18, 2025
473afda
[virtdisk] Extract fill_info function
xmkg Dec 18, 2025
7098b8c
[virtdisk] Simplify get_virtual_disk_info
xmkg Dec 18, 2025
273a719
[hyperv-vm] Reorder includes
xmkg Dec 18, 2025
dd3c436
[hyperv-hcs] Remove unused stuff
xmkg Dec 18, 2025
48ee45e
[hyperv-vm] Use C++20 stuff
xmkg Dec 18, 2025
0dcfe23
[hyperv-vm] Use VM name as log category
xmkg Dec 18, 2025
58593d1
[hyperv-vm] Call non-virtual handle_state_update in constr
xmkg Dec 18, 2025
ba02c51
[hyperv-vm] Change shutdown timeout msg
xmkg Dec 18, 2025
6222d87
[hyperv-vm] Remove future FIXMEs/commented out code
xmkg Dec 18, 2025
52fb98f
[vm] Use common constant for shutdown timeout
xmkg Dec 18, 2025
c630dc8
[hyperv-vm] Fetch updated state in current_state()
xmkg Dec 18, 2025
c3d8173
[hyperv-vm] Mark fetch_state_from_api as const
xmkg Dec 18, 2025
e2ae359
[hyperv-tests] Update tests to reflect changes
xmkg Dec 18, 2025
d4ed65f
[hyperv-hcn] Remove unused tags
xmkg Dec 18, 2025
d382e06
[hyperv-factory] throw if bridge creation fails
xmkg Dec 18, 2025
f461f4a
[hyperv-factory] Use specific data dir function
xmkg Dec 18, 2025
c6e6644
[hyperv-factory] Handle qprocess exit code better
xmkg Dec 18, 2025
3290567
[hyperv-factory] Use find_if in clone_vm_impl
xmkg Dec 18, 2025
97401d3
[platform-win] Move wsa_init_wrapper to shared
xmkg Dec 18, 2025
478beb4
[platform-win] Move get_windows_version to shared/
xmkg Dec 18, 2025
605dcf7
[platform-win] Move guid formatter to shared/
xmkg Dec 18, 2025
bcd9c91
[hyperv] Refactor narrow/wide string conversion
xmkg Dec 18, 2025
ae52a3c
[hyperv-hcn] Replace stray prototype code with real
xmkg Dec 18, 2025
4d4c57c
[hyperv-api] Simplify JSON formatting even further
xmkg Dec 18, 2025
a398318
[hyperv-api] Unify all json template names
xmkg Dec 18, 2025
4eed171
[hyperv-tests] Move integration tests to a separate executable
xmkg Jan 7, 2026
379bca4
[gha-wf] Update workflow files after unit/integration split
xmkg Jan 7, 2026
692d24c
[hyperv-hcn] Leave logging to caller (create_network)
xmkg Jan 7, 2026
78ba95f
[hyperv-hcs] Move append_if_supported to anon namespace
xmkg Jan 7, 2026
0ec5c8e
[hyperv-hcs] Fix a few comment and log nitpicks
xmkg Jan 7, 2026
478184b
[hyperv-hcs] Use hcs_system_handle from header instead
xmkg Jan 7, 2026
d55fe0d
[hcs-plan9] Apply review suggestions
xmkg Jan 7, 2026
cad9e82
[hyperv-hcs] Use HCS_EVENT fwdecl instead of void
xmkg Jan 7, 2026
ed2f519
[hyperv-hcs] More nitpick fixes
xmkg Jan 7, 2026
84eb50b
[hyperv-hcs] Remove default values from derived vcalls
xmkg Jan 7, 2026
0084ef1
[hyperv-hcn] Do not log in open_network. Log levels debug->trace
xmkg Jan 8, 2026
9ac91d0
[hyperv-hcs] Move default_ssh_port to constants
xmkg Jan 8, 2026
6b7efb1
[hyperv-hcs-vm] Throw if VM open fails
xmkg Jan 8, 2026
7f67955
[hyperv-hcs-vm] Extract create_endpoints and grant_access_to_scsi_device
xmkg Jan 8, 2026
1c2f77c
[gha-linux] Change the id for integration tests
xmkg Jan 8, 2026
c37812c
[hyperv-hcs-factory] Implement endpoint cleaup upon vm destruction
xmkg Jan 8, 2026
021913b
[hyperv] Make the linter happy again
xmkg Jan 8, 2026
a128e93
[hyperv-hcs] Implement hypervisor_health_check
xmkg Jan 8, 2026
36468bb
[base-vm] Remove redundant std::views::all()
xmkg Jan 8, 2026
03e3c51
[base-vm] Try to navigate around gcc ranges bug
xmkg Jan 8, 2026
fd5916f
[base-vm] Revert snapshot filtering back to loop
xmkg Jan 12, 2026
59e3a82
[hyperv-hcs] Add HcsSaveComputeSystem, and mocks.
xmkg Jan 12, 2026
bc06a20
[hyperv-hcs] Add HcsCreateEmpty<Guest|Runtime>StateFile functions
xmkg Jan 12, 2026
52974af
[hyperv-hcs] More work for enabling suspend-to-disk feat.
xmkg Jan 14, 2026
a2a0715
[hyperv-hcs] Fix unit tests after changes
xmkg Jan 15, 2026
5f4366f
[hyperv-hcs] Fix grant_vm_access not being called for empty state files
xmkg Jan 15, 2026
012deab
[tests] Update hyper-v test paths after rebase
xmkg Jan 21, 2026
70c94b0
[cmake] Fix cmake include paths
xmkg Jan 21, 2026
c896c35
[hyperv-tests] Update include paths
xmkg Jan 21, 2026
2bcbecb
[windows-macos] Remove superfluous ccache clear stats
xmkg Jan 21, 2026
4209cfb
[gha-linux] Don't fail if instance is already running
xmkg Jan 21, 2026
dee2ad4
[hyperv-hcs] Implement suspend to disk feature
xmkg Jan 22, 2026
ffeed85
[network-interface] Rename interface to iface
xmkg Mar 2, 2026
4c84acc
[hyperv-hcs] Do not ignore guest/runtime state file api call results
xmkg Mar 2, 2026
0c572bd
[multipass/utils] Rename static_bimap to static_bi_map
xmkg Mar 2, 2026
a19cc97
[hyperv-hcs] Apply ricab's suggestion for comment
xmkg Mar 2, 2026
dd7a781
[hyperv-hcs] Bump unknown event log severity to warn
xmkg Mar 2, 2026
1a90cb1
[hyperv-hcs] Apply review suggestions
xmkg Mar 2, 2026
f74df73
[hyperv-hcs] Collapse else-if
xmkg Mar 2, 2026
e05a6fd
[hyperv-hcs] Add state check before shutdown
xmkg Mar 2, 2026
788f1f4
[hyperv-hcs] Suspend: apply review suggestions
xmkg Mar 2, 2026
bbcc8c1
[hyperv-hcs] Apply review suggestions to remove_resources_for_impl
xmkg Mar 2, 2026
676f4dc
[hyperv-hcs] Throw if disk resize fails
xmkg Mar 2, 2026
5a9aec2
[hyperv-hcs] Fix include order
xmkg Mar 2, 2026
f4c0d34
[hyperv-hcs] Remove "WiFi" from adapters filter
xmkg Mar 2, 2026
30d23e7
[virtdisk] Make child to parent merge behavior clearer
xmkg Mar 2, 2026
d9e4c97
[virtdisk] Update doc link
xmkg Mar 2, 2026
8ab99c4
[virtdisk] Better encapsulate the predecessor info
xmkg Mar 2, 2026
6629b1a
[hyperv-hcs] Simplify maybe_create_compute_system
xmkg Mar 9, 2026
22b0c0c
[hyperv-hcs] Extract set_compute_system_callback_handler
xmkg Mar 9, 2026
f1a9e26
[hyperv-hcs] Extract make_endpoint_parameters
xmkg Mar 9, 2026
e6f4dbb
[hyperv-hcs] Remove Plan9 code
xmkg Mar 9, 2026
db47cdd
[hyperv-hcs] Remove already created endpoints on failure
xmkg Mar 9, 2026
8e40564
[hyperv-hcs] Remove delete-before-create from try_create_endpoints
xmkg Mar 9, 2026
3a0f7e2
[hyperv-hcn] Introduce enumerate_networks and query_network
xmkg Mar 9, 2026
d0d9f18
[hyperv-hcn] enumerate_networks now return GUIDs
xmkg Mar 9, 2026
49ac279
[hyperv-hcs] Add Hyper-V vSwitches to the network cmd output
xmkg Mar 9, 2026
cf1136e
[hyperv-hcs] Remove redundant network setup code
xmkg Mar 9, 2026
02ac12f
[hyperv-hcs] Move the feature behind the HYPERV_HCS_ENABLED flag
xmkg Mar 9, 2026
3bb2261
[hyperv-hcs] Fix factory create_vm tests after network update
xmkg Mar 9, 2026
528a6b5
[hyperv-virtdisk] Remove virtdisk snapshot
xmkg Mar 9, 2026
0c3abbb
[network-interface] make the linter happy
xmkg Mar 9, 2026
b5bb3df
[hyperv-hcn] Make the linter happy
xmkg Mar 9, 2026
8039125
[cmake] Add HYPERV_HCS_ENABLED definition
xmkg Mar 13, 2026
5676e7d
[hyperv-hcs] Reintroduce delete_endpoint
xmkg Mar 13, 2026
76edfa5
[hyperv-hcs] Re-format files
xmkg Mar 17, 2026
9692b46
[hyperv-hcs] Remove confusing bool op from ResultCode
xmkg Mar 17, 2026
202c98c
[hyperv-hcs] Add warnings on failed network enum/query
xmkg Mar 17, 2026
a350b73
[hyperv-hcs] Issue warning if endpoint removal fails
xmkg Mar 17, 2026
250596e
[hyperv-hcs] Also call update_adapter_authorizations
xmkg Mar 17, 2026
e119929
[hyperv-hcs] Simplify test comments
xmkg Mar 17, 2026
c0c3267
[virtdisk] Remove line anchor from link
xmkg Mar 17, 2026
14b0d8c
[hyperv-hcs] Fix tests after changes
xmkg Mar 19, 2026
91cde63
[hyperv-hcn] Remove debug leftover
xmkg Mar 19, 2026
2953678
[hyperv-hcs] Accept variadic args for HcsPath
xmkg Mar 23, 2026
3aa7535
[platform-win] Throw if wsa init fails
xmkg Mar 23, 2026
f755018
[hyperv-hcs] Changes after vm_image API changes
xmkg Apr 1, 2026
766952b
[hyperv-hcn] Query: make name non-optional
xmkg Apr 1, 2026
1f88731
[hyperv-tests] Remove expect debug log calls
xmkg Apr 1, 2026
f7aea0a
[hyperv-tests] Remove expect debug log calls, pt2
xmkg Apr 1, 2026
95ed70f
[hyperv-hcs-tests] Use designated initializers
xmkg Apr 1, 2026
54ab42e
[hyperv-tests] Remove more duplication
xmkg Apr 1, 2026
8fed4a8
Revert "[hyperv-hcs] Remove Plan9 code"
xmkg Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ PointerAlignment: Left
---
Language: Cpp
Standard: c++20
IncludeCategories:
- Regex: '^<windows\.h>$'
Priority: 100
- Regex: '^<initguid\.h>$'
Priority: 200
- Regex: '^<virtdisk\.h>$'
Priority: 300
# "If none of the regular expressions match, INT_MAX is assigned as category."
---
Language: ObjC
---
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ jobs:
# we need to override it at the runner level.
sudo bash -c 'echo "/coredump/%e.%p.%t" > /proc/sys/kernel/core_pattern'

- name: Test
- name: Run unit tests
id: test
if: ${{ matrix.build-type == 'Debug' }}
timeout-minutes: 2
Expand All @@ -237,6 +237,26 @@ jobs:
LD_LIBRARY_PATH=/root/stage/usr/lib/x86_64-linux-gnu/:/root/stage/lib/:/root/parts/multipass/build/lib/ \
/root/parts/multipass/build/bin/multipass_tests"

- name: Run integration tests
id: integration-tests
if: ${{ matrix.build-type == 'Debug' }}
timeout-minutes: 2
run: |

trap 'echo "MULTIPASS_TESTS_EXIT_CODE=$?" >> $GITHUB_ENV' EXIT
instance_name=`/snap/bin/lxc --project snapcraft --format=csv --columns=n list | grep multipass`
/snap/bin/lxc --project snapcraft start $instance_name | true
# Let's print the core pattern so we can check if it's successfully propagated to the container.
/snap/bin/lxc --project snapcraft exec $instance_name -- bash -c 'cat /proc/sys/kernel/core_pattern'
# Create the directory for the coredumps
/snap/bin/lxc --project snapcraft exec $instance_name -- bash -c 'mkdir -p /coredump'
# Enable coredumps by setting the core dump size to "unlimited", and run the tests.
/snap/bin/lxc --project snapcraft exec $instance_name -- bash -c "\
ulimit -c unlimited && \
env CTEST_OUTPUT_ON_FAILURE=1 \
LD_LIBRARY_PATH=/root/stage/usr/lib/x86_64-linux-gnu/:/root/stage/lib/:/root/parts/multipass/build/lib/ \
/root/parts/multipass/build/bin/multipass_integration_tests"

- name: Measure coverage
id: measure-coverage
if: ${{ matrix.build-type == 'Coverage' }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/windows-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,16 @@ jobs:
- name: Build
run: cmake --build ${{ env.BUILD_DIR }}

- name: Test
- name: Run unit tests
working-directory: ${{ env.BUILD_DIR }}
run: |
bin/multipass_tests

- name: Run integration tests
working-directory: ${{ env.BUILD_DIR }}
run: |
bin/multipass_integration_tests

- name: Package
id: cmake-package
working-directory: ${{ env.BUILD_DIR }}
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ endif()
# Boost config
find_package(Boost CONFIG REQUIRED COMPONENTS json)

# Dependencies satisfied by CMake
include(src/cmake/cmake-deps.cmake)

# OpenSSL config
find_package(OpenSSL CONFIG REQUIRED)

Expand Down Expand Up @@ -283,7 +286,12 @@ if(MSVC)
add_definitions(-DMULTIPASS_PLATFORM_WINDOWS)
add_definitions(-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DSECURITY_WIN32)
set(MULTIPASS_BACKENDS hyperv virtualbox)
if(HYPERV_HCS_ENABLED)
add_definitions(-DHYPERV_HCS_ENABLED=1)
list(APPEND MULTIPASS_BACKENDS hyperv_api)
endif()
set(MULTIPASS_PLATFORM windows)
else()
add_compile_options(-Werror -Wall -pedantic -fPIC)
Expand Down
3 changes: 3 additions & 0 deletions feature-flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ include(src/cmake/feature-flag.cmake)

# Multipass backend integrating with Apple Virtualization framework
feature_flag(APPLEVZ_ENABLED "AppleVZ backend" APPLE)

# The new Windows backend based on Hyper-V Host Compute System / Host Compute Networking APIs
feature_flag(HYPERV_HCS_ENABLED "Hyper-V HCS backend" WIN32)
4 changes: 4 additions & 0 deletions include/multipass/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ constexpr auto petenv_default = "primary";
constexpr auto timeout_exit_code = 5;
constexpr auto authenticated_certs_dir = "authenticated-certs";
constexpr auto home_in_instance = "/home/ubuntu";

constexpr std::chrono::milliseconds vm_shutdown_timeout =
300000ms; // unit: ms, 5 minute timeout for shutdown/suspend
constexpr auto default_ssh_port = 22;
} // namespace multipass
29 changes: 29 additions & 0 deletions include/multipass/exceptions/wsa_init_exception.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (C) Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#pragma once

#include <multipass/exceptions/formatted_exception_base.h>

namespace multipass
{

struct WSAInitException : FormattedExceptionBase<>
{
using FormattedExceptionBase::FormattedExceptionBase;
};
} // namespace multipass
18 changes: 16 additions & 2 deletions include/multipass/file_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,34 @@ class FileOps : public Singleton<FileOps>
const fs::path& dist,
fs::copy_options copy_options,
std::error_code& ec) const;
virtual void rename(const fs::path& old_p, const fs::path& new_p) const;
virtual bool exists(const fs::path& path) const;
virtual bool exists(const fs::path& path, std::error_code& err) const;
virtual bool is_symlink(const fs::path& path) const;
// [[deprecated("Use non-std::error_code overload instead!")]]
virtual bool exists(const fs::path& path, std::error_code& err) const noexcept;
// [[deprecated("Use non-std::error_code overload instead!")]]
virtual bool is_directory(const fs::path& path, std::error_code& err) const;
// [[deprecated("Use non-std::error_code overload instead!")]]
virtual bool create_directory(const fs::path& path, std::error_code& err) const;
// [[deprecated("Use non-std::error_code overload instead!")]]
virtual bool create_directories(const fs::path& path, std::error_code& err) const;
virtual bool remove(const fs::path& path, std::error_code& err) const;
virtual bool remove(const fs::path& path) const;
// [[deprecated("Use non-std::error_code overload instead!")]]
virtual bool remove(const fs::path& path, std::error_code& err) const noexcept;
// [[deprecated("Use non-std::error_code overload instead!")]]
virtual void create_symlink(const fs::path& to,
const fs::path& path,
std::error_code& err) const;
//[[deprecated("Use non-std::error_code overload instead!")]]
virtual fs::path read_symlink(const fs::path& path, std::error_code& err) const;
//[[deprecated("Use non-std::error_code overload instead!")]]
virtual fs::file_status status(const fs::path& path, std::error_code& err) const;
//[[deprecated("Use non-std::error_code overload instead!")]]
virtual fs::file_status symlink_status(const fs::path& path, std::error_code& err) const;
//[[deprecated("Use non-std::error_code overload instead!")]]
virtual std::unique_ptr<RecursiveDirIterator>
recursive_dir_iterator(const fs::path& path, std::error_code& err) const;
//[[deprecated("Use non-std::error_code overload instead!")]]
virtual std::unique_ptr<DirIterator> dir_iterator(const fs::path& path,
std::error_code& err) const;
virtual fs::path weakly_canonical(const fs::path& path) const;
Expand Down
6 changes: 2 additions & 4 deletions include/multipass/network_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ struct NetworkInterface

inline void tag_invoke(const boost::json::value_from_tag&,
boost::json::value& json,
const NetworkInterface& interface)
const NetworkInterface& iface)
{
json = {{"id", interface.id},
{"mac_address", interface.mac_address},
{"auto_mode", interface.auto_mode}};
json = {{"id", iface.id}, {"mac_address", iface.mac_address}, {"auto_mode", iface.auto_mode}};
}

inline NetworkInterface tag_invoke(const boost::json::value_to_tag<NetworkInterface>&,
Expand Down
5 changes: 4 additions & 1 deletion include/multipass/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ struct Signal
bool wait_for(const T& timeout)
{
std::unique_lock<std::mutex> lock{mutex};
return cv.wait_for(lock, timeout, [this] { return signaled; });
const auto ret = cv.wait_for(lock, timeout, [this] { return signaled; });
signaled = false;
return ret;
}

void wait()
{
std::unique_lock<decltype(mutex)> lock{mutex};
cv.wait(lock, [this] { return signaled; });
signaled = false;
}

void signal()
Expand Down
47 changes: 47 additions & 0 deletions include/multipass/utils/static_bi_map.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (C) Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#pragma once

#include <unordered_map>

#include <multipass/disabled_copy_move.h>

namespace multipass
{

/**
* Inefficient, static bidirectional map using two std::unordered_map's.
*/
template <typename K, typename V>
struct static_bi_map : private multipass::DisabledCopyMove
{
static_bi_map(std::initializer_list<std::pair<const K, V>> init)
: left(init), right([&init]() {
std::unordered_map<V, K> map;
for (const auto& [k, v] : init)
map.emplace(v, k);
return map;
}())
{
}

const std::unordered_map<K, V> left;
const std::unordered_map<V, K> right;
};

} // namespace multipass
12 changes: 9 additions & 3 deletions include/multipass/virtual_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
#include "network_interface.h"

#include <QDir>
#include <fmt/format.h>

#include <cassert>
#include <chrono>
#include <condition_variable>
#include <functional>
#include <memory>
#include <mutex>
#include <string>
#include <vector>

#include <fmt/format.h>

namespace multipass
{
struct IPAddress;
Expand All @@ -43,6 +44,7 @@ class Snapshot;
class VirtualMachine : private DisabledCopyMove
{
public:
// TODO: Get rid of the VirtualMachine::State in favor of InstanceStatus
enum class State
{
off,
Expand Down Expand Up @@ -99,7 +101,8 @@ class VirtualMachine : private DisabledCopyMove

using SnapshotVista = std::vector<std::shared_ptr<const Snapshot>>; // using vista to avoid
// confusion with C++ views
virtual SnapshotVista view_snapshots() const = 0;
using SnapshotPredicate = std::function<bool(const Snapshot&)>;
virtual SnapshotVista view_snapshots(SnapshotPredicate predicate = {}) const = 0;
virtual int get_num_snapshots() const = 0;

virtual std::shared_ptr<const Snapshot> get_snapshot(const std::string& name) const = 0;
Expand Down Expand Up @@ -169,6 +172,9 @@ struct fmt::formatter<multipass::VirtualMachine::State, char> : fmt::formatter<s
case multipass::VirtualMachine::State::unknown:
v = "unknown";
break;
default:
assert(0 && "unhandled VM state");
break;
}

return fmt::formatter<string_view>::format(v, ctx);
Expand Down
1 change: 1 addition & 0 deletions src/client/gui/lib/platform/windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class WindowsPlatform extends MpPlatform {
Map<String, String> get drivers => const {
'hyperv': 'Hyper-V',
'virtualbox': 'VirtualBox',
'hyperv_api': 'Hyper-V (API)'
};

@override
Expand Down
25 changes: 25 additions & 0 deletions src/cmake/cmake-deps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

include(FetchContent)

# Declare and fetch out_ptr
# TODO: C++23: Remove this and use std::out_ptr instead.
FetchContent_Declare(
out_ptr
GIT_REPOSITORY https://github.com/soasis/out_ptr.git
GIT_TAG 02a577edfcf25e2519e380a95c16743b7e5878a1
)

FetchContent_MakeAvailable(out_ptr)
3 changes: 2 additions & 1 deletion src/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function(add_target TARGET_NAME)
shared_win
scope_guard
wineventlogger
OpenSSL::applink)
OpenSSL::applink
Secur32)
elseif(APPLE)
add_library(${TARGET_NAME} STATIC
platform_osx.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/platform/backends/hyperv/hyperv_virtual_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ mp::VirtualMachine::State mp::HyperVVirtualMachine::current_state()

int mp::HyperVVirtualMachine::ssh_port()
{
return 22;
return default_ssh_port;
}

void mp::HyperVVirtualMachine::handle_state_update()
Expand Down
2 changes: 1 addition & 1 deletion src/platform/backends/hyperv/hyperv_virtual_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class HyperVVirtualMachine final : public BaseVirtualMachine
const Path& dest_instance_dir);
~HyperVVirtualMachine();
void start() override;
void shutdown(ShutdownPolicy shutdown_policy = ShutdownPolicy::Powerdown) override;
void shutdown(ShutdownPolicy shutdown_policy) override;
void suspend() override;
State current_state() override;
int ssh_port() override;
Expand Down
Loading
Loading