Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
317 commits
Select commit Hold shift + click to select a range
d970fcb
[hyperv-virtdisk-snapshot] use MP_FILEOPS for filesystem
xmkg May 6, 2025
744c9e0
[hyperv-virtdisk] fix unit tests
xmkg May 6, 2025
e45e6ea
[hyperv-virtdisk-ut] add unit tests for merge & reparent
xmkg May 7, 2025
54193b1
[hyperv-virtdisk-it] add integration tests for merge & reparent
xmkg May 7, 2025
a53bceb
[hyperv-api] grooming & add more logs
xmkg May 7, 2025
504ac2c
[hyperv-api] replace string_to_wstring with maybe_widen
xmkg May 7, 2025
7e9797b
[hyperv-api] remove redundant hyperv_api_common{.cpp/.h}
xmkg May 7, 2025
8dffdf7
[platform_win] remove commented out get_network_interfaces_info fn
xmkg May 7, 2025
c96dfde
[hyperv-hcn] move guid_from_string to HCN wrapper
xmkg May 7, 2025
75ba252
[platform/win] remove guid_to_string functions
xmkg May 7, 2025
6279123
[platform/win] comment ip_utils
xmkg May 7, 2025
2b7af10
[hyperv-hcs] extract SCSI device to its own entity
xmkg May 7, 2025
2a6aadc
[hyperv-api] make the linter happy
xmkg May 7, 2025
997cead
[hyperv-hcs] extract network adapter to its own entity
xmkg May 7, 2025
2da1940
[hyperv-hcs] replace AddEndpointParameters with HcsNetworkAdapter
xmkg May 7, 2025
bd9e4d3
[hyperv-hcn] rename {add,rm}_endpoint to {add,rm}_network_adapter
xmkg May 7, 2025
347d045
[hyperv-hcs] move plan9 shares formatting to its own source
xmkg May 7, 2025
5fd778c
[hyperv-hcs] move CreateComputeSystemParams formatting to src/
xmkg May 7, 2025
7b6465f
[hyperv-hcs-hcn] replace fmt::format("{}", v) with fmt::to_string
xmkg May 7, 2025
6db812f
[hyperv-api-utils] introduce out_ptr type
xmkg May 9, 2025
0678ecb
[hyperv-util] gate void** operator to P != void
xmkg May 9, 2025
c3669a5
[hyperv-hcn] use out_ptr where appropriate
xmkg May 9, 2025
e751414
[out_ptr] switch to P1132 reference implementation
xmkg May 9, 2025
680a9e0
[hyperv-hcs] introduce modify_compute_system API and HcsRequest
xmkg May 14, 2025
8a9d583
[hyperv-hcs] replace add/remove_network_adapter with modify_cs
xmkg May 14, 2025
79d9b12
[hyperv-hcs] replace resize_memory with modify_compute_system
xmkg May 15, 2025
b931732
[lint] make the linter happy
xmkg May 15, 2025
d2ed8dc
[hyperv-hcs] replace 9p API functions with modify_compute_system
xmkg May 16, 2025
6c89ee2
[hyperv-hcs] remove update_cpu_count function
xmkg May 16, 2025
9efdc62
[hyperv-hcs] introduce HcsPath type
xmkg May 28, 2025
b74e5dd
[platform/win] rewrite get_username using native Win32 API
xmkg May 28, 2025
357040f
[smb_mount] use Win32 API for folder permission checks
xmkg May 30, 2025
3577280
[hyperv-hcs] use smb mount handler as native mount handler
xmkg May 30, 2025
96b9533
[hyperv-hcs-vm] implement add_network_interface function
xmkg Jun 12, 2025
9ff6dcf
[platform/win] prevent clang-format messing with the include order
xmkg Jun 12, 2025
c70d88b
[hyperv-hcs-hcn] format code with the latest rule changes #2
xmkg Jun 12, 2025
006acc8
[tests/hyperv_api] remove commented out obsolete code block
xmkg Jul 9, 2025
aaa8539
[hyperv_api] constexpr -> constexpr static to make msvc 19 happy
xmkg Jul 16, 2025
4b3881c
[hyperv-hcs] add error message lookup to result code format output
xmkg Jul 18, 2025
be1446d
[hyperv-hcs] add an optional hint to the result code format output
xmkg Jul 18, 2025
b6b73df
[hyperv-hcs] replace header guards with `#pragma once`
xmkg Jul 18, 2025
b6ea602
[hyperv-hcs] make the linter happy
xmkg Jul 16, 2025
e64ead3
[hyper-v] add missing formatters for the api table members
xmkg Jul 18, 2025
2743e64
[hyperv-hcs] small touch-ups to perform_[hcn|hcs]_operation
xmkg Jul 18, 2025
1f981f3
[hyperv-hcs] implement get_os_supported_schema_version() function
xmkg Jul 18, 2025
dcc6937
[hyperv-hcs] move get_os_supported_schema_version to schema version src
xmkg Jul 18, 2025
15253ac
[hyperv-hcs] move get_os_supported_schema_version to singleton class
xmkg Jul 18, 2025
7a8e380
[hyperv-hcs] vm json: only add "services" section if version >= 2.5
xmkg Jul 18, 2025
3da5be3
[hyperv-hcs] better handling of leading comma in ver dependent sections
xmkg Jul 18, 2025
8306a8e
[hyperv-hcs] update hcs/hcn ut expect_log calls to reflect changes
xmkg Jul 18, 2025
a06bd75
[hyperv-hcs] mock SchemaUtils in hcs unit tests
xmkg Jul 18, 2025
ea71470
[hyperv-hcs] remove terminate return msg expect on hcs intg. tests
xmkg Jul 18, 2025
486166a
[hyperv-hcs] format the code to make the linter happy
xmkg Jul 18, 2025
bac8b4e
[virtdisk] implement list_virtual_disk_chain function
xmkg Jul 25, 2025
a7d9c80
[hyperv-hcs] grant vm access to all disks in the vhdx chain
xmkg Jul 25, 2025
96d261c
[hyperv-hcs] implement set_compute_system_callback function
xmkg Jul 25, 2025
0b3f3d7
[hyperv-hcs] convert hcs api from name to handle based
xmkg Jul 25, 2025
53d6c98
[signal] reset signaled state after wait
xmkg Jul 25, 2025
60cb002
[hyperv-hcs] add shutdown signal wait to shutdown code
xmkg Jul 25, 2025
14407d2
[hyperv-hcs] replace shutdown signal with state poll
xmkg Jul 25, 2025
84f9630
[hyperv-hcs] shutdown: do the state poll wait only for non-gcs shutdown
xmkg Jul 26, 2025
b4f5668
[hyperv-hcs] resize_memory: disable runtime memory resizing
xmkg Jul 26, 2025
50da64e
[hyperv-hcs] call set_compute_system_callbacks in maybe_create_comput…
xmkg Jul 26, 2025
984cceb
[hyperv-hcs] fix resize_memory, resize_disk and update_cpus
xmkg Jul 26, 2025
684a8ca
[hyperv-hcs] fix linter errors
xmkg Jul 26, 2025
e2d22c5
[hyperv-hcs] snapshot: fix head disk reparent/merge logic on erase
xmkg Jul 26, 2025
9ed254b
[hyperv-hcs] fix host compute system api wrapper unit tests
xmkg Aug 14, 2025
22163ac
[hyperv-virtdisk] fix virtdisk wrapper unit tests
xmkg Aug 14, 2025
dc41ec3
[platform/win] fix linter error
xmkg Aug 14, 2025
2c55529
[hyperv/virtdisk] use std::filesystem::equivalent for path comparison
xmkg Aug 15, 2025
ac64b44
[hyperv-virtdisk] Disable list_parents test
xmkg Sep 10, 2025
7dca486
[tests/hyperv] Add mock hyperv hcs wrapper
xmkg Sep 12, 2025
d0f094a
[tests/hyperv] Add mock hyperv hcn wrapper
xmkg Sep 12, 2025
c48c369
[tests/hyperv] Add mock hyperv virtdisk wrapper
xmkg Sep 12, 2025
cd6d4c7
[tests/hyperv] Add boilerplate for VM unit tests
xmkg Sep 12, 2025
4581f09
[hyperv-vm] Respect previous VM state on start
xmkg Sep 16, 2025
697f9cd
[hyperv-hcs] Poll the state while waiting for shutdown
xmkg Sep 16, 2025
b98c227
[hyperv-hcs] Add eq operator to HcsRequestType and HcsResourcePath
xmkg Sep 16, 2025
fe001a8
[hyperv-hcs] consider "stopped" state as not running too
xmkg Sep 16, 2025
47b4b35
[hyperv-hcs] remove "final" from the VM class
xmkg Sep 16, 2025
510cc31
[hyperv-hcs] ssh-hostname: provide default for timeout
xmkg Sep 16, 2025
b5ea211
[tests/hyperv] Add remaining virtual machine unit tests
xmkg Sep 16, 2025
94a6c07
[hyperv-hcs] Add two more eq operators
xmkg Sep 16, 2025
5b01b29
[tests/hyperv] Add unit tests for hcs_virtual_machine_factory
xmkg Sep 16, 2025
7d0091f
[tests-virtdisk-it] Re-enable list_parents
xmkg Sep 16, 2025
73ad323
[platform/win] List IEEE 802.11 devices in get_network_interfaces_info
xmkg Sep 16, 2025
bb3bc67
[cmake-deps] Fix typo
xmkg Oct 3, 2025
1823927
[hyperv-hcn] Use front() and back()
xmkg Oct 3, 2025
7972d84
[hyperv-api] Be consistent in [[nodiscard]] use
xmkg Oct 3, 2025
01743ba
[hyperv-hcs] Remove `struct` keyword from hints to not to confuse cla…
xmkg Oct 3, 2025
e5885f8
[hyperv-api] Fix build after C++20 upgrade
xmkg Oct 10, 2025
2e44032
[hyperv-api] Make linter happy again
xmkg Oct 10, 2025
5388cad
[hyperv-hcs] Remove require_snapshot_support
xmkg Oct 17, 2025
a458b40
[base-virt-machine] Use ranges for view_snapshots
xmkg Oct 17, 2025
e06d2a2
[test-base-virt-machine] Add predicate test for view_snapshots
xmkg Oct 17, 2025
8469c0c
[hyperv-hcs] Address review comments, 1
xmkg Oct 17, 2025
8682e75
[cmake] Move src/cmake to top level
xmkg Oct 17, 2025
fa82024
[cmake/cmake-deps] Add C++23 removal comment for out_ptr
xmkg Oct 17, 2025
3fff76d
[hyperv-api] Remove const from result members
xmkg Oct 17, 2025
76e66dd
[platform_win] Move header to src/platform
xmkg Oct 17, 2025
2256493
[hyperv-api] Wrap api table refs with std::reference_wrapper
xmkg Oct 17, 2025
d82ea79
[hyperv-hcn] Make wrapper constr/assign fns protected
xmkg Oct 17, 2025
963aad1
[hyperv-hcs] Make wrapper if constr/assign fns protected
xmkg Oct 17, 2025
a3ab5ec
[hyperv-api] Switch back to const api table
xmkg Oct 17, 2025
23bd7b9
[hyperv-hcs] Inherit from formatter<string_view> in all formatters
xmkg Oct 17, 2025
10b0871
[fileops] Remove noexcept overload of rename
xmkg Oct 17, 2025
faf789a
[hyperv-hcs-vm] Add a warning if bridge creation fails
xmkg Oct 17, 2025
9f8ede6
[hyperv-hcs] Make the linter happy again
xmkg Oct 17, 2025
e20ffb2
[virtual-machine] Add assert to default fmt case
xmkg Oct 30, 2025
15c16b8
[virtual-machine] Add a TODO to replace State
xmkg Oct 30, 2025
e65fc5f
[file-ops] Deprecate std::error_code overloads
xmkg Oct 30, 2025
8c10c0b
[hyperv-api-table] Remove comment
xmkg Oct 30, 2025
5a9a547
[hyperv-hcs] Rename "bridge" to "vswitch"
xmkg Oct 30, 2025
3a3bb10
[hv-string-conv] Mark as() decl as deleted
xmkg Oct 30, 2025
9095d31
[hyperv-api] Fix build after changes
xmkg Nov 18, 2025
c6bb473
[hyperv-hcn] Extract endpoint json rendering
xmkg Nov 18, 2025
ad9adc2
[hyperv-hcn] Extract network params json rendering
xmkg Nov 18, 2025
74d0ff8
[hyperv-hcn] Fix some of the review comments
xmkg Nov 18, 2025
d86f6ef
[file-ops] Comment out deprecations
xmkg Nov 18, 2025
0272cab
[hyperv-hcs] Move HCS api table to Singleton
xmkg Nov 18, 2025
8205677
[virtual-machine] Fix linter warning
xmkg Nov 18, 2025
c663426
[hyperv-hcs] Move HCS wrapper to Singleton
xmkg Nov 19, 2025
d794b26
[hyperv-hcn] Move HCN API table to Singleton
xmkg Nov 19, 2025
639d661
[hyperv-hcn] Move HCN wrapper to Singleton
xmkg Nov 19, 2025
5097652
[hyperv-api] Drop _api from hcs/hcn wrapper naming
xmkg Nov 19, 2025
8404039
[hyperv-api] Make the linter happy
xmkg Nov 19, 2025
10a7386
[hyperv-virtdisk] Move VirtDisk API table to Singleton
xmkg Nov 21, 2025
df8360d
[hyperv-virtdisk] Drop _api from virtdisk_api_wrapper
xmkg Nov 21, 2025
4b7edf0
[hyperv-virtdisk] Move VirtDisk wrapper to Singleton
xmkg Nov 21, 2025
af66629
[hyperv-api] Remove redundant fwdecl header
xmkg Nov 21, 2025
9fb3327
[hyperv-hcn] Add desc for HcnIpam
xmkg Nov 21, 2025
e389038
[hyperv-hcn] Quote mac address in JSON
xmkg Nov 21, 2025
2b9f63e
[hyperv-hcn] Do not quote null mac addr
xmkg Nov 24, 2025
5ee88fa
[hyperv-hcs] Update code after vm consolidation
xmkg Dec 9, 2025
e165826
[base-virtual-machine] Try to make gcc-11 happy
xmkg Dec 9, 2025
80437e6
[hyperv-hcs] Add missing initializer
xmkg Dec 9, 2025
aca0769
[hyoerv-hcs] Apply couple of review suggestions
xmkg Dec 9, 2025
4edf6b2
[hyperv-hcs] fwdecl HCS_EVENT for parse_event
xmkg Dec 9, 2025
0a71310
[hyperv-api] Remove typename from FormatContext::iterator
xmkg Dec 9, 2025
417a797
[hyperv-hcs] Use static_bimap for enum<->str translation
xmkg Dec 9, 2025
b66a201
[hyperv-api] Remove function comments
xmkg Dec 9, 2025
bdb13f8
[hyperv-hcs] Remove more comments, drive-by lint fixes
xmkg Dec 9, 2025
01990e3
[hyperv-api] Remove redundant static from constexpr
xmkg Dec 9, 2025
a20abaa
[hyperv-api] Replace auto with type
xmkg Dec 9, 2025
cea7b50
[hyperv-hcs] Switch cpu count and mem order in formatting
xmkg Dec 9, 2025
d913f6b
[hyperv-hcs] Simplify schema version code a bit
xmkg Dec 9, 2025
930f200
[hyperv-api] Remove _table suffix from API decls
xmkg Dec 9, 2025
86bbd22
[hyperv-api] Rename append_version_dependent_section to append_if_sup…
xmkg Dec 9, 2025
8e08a7a
[clang-format] Assign priorities for windows.h and virtdisk.h
xmkg Dec 9, 2025
662cc63
[clang-format] Also prioritize initguid.h
xmkg Dec 9, 2025
5e5eb0e
[static-bimap] Apply review suggestions
xmkg Dec 18, 2025
5dfacf5
[platform-win] Apply review suggestions
xmkg Dec 18, 2025
2273dca
[platform-win] Rename IEEE 802.11 to WiFi
xmkg Dec 18, 2025
4599fc7
[hyperv-hcn] Reflow some comments
xmkg Dec 18, 2025
b232316
[virtdisk] Describe source and parent path behavior
xmkg Dec 18, 2025
e459665
[virtdisk] Simplify exception inheritance
xmkg Dec 18, 2025
52a6440
[virtdisk-snapshot] Apply some review suggestions
xmkg Dec 18, 2025
a0f68d2
[virtdisk-snapshot] Add an error msg for remove failure
xmkg Dec 18, 2025
db086ce
[virtdisk] Extract fill_info function
xmkg Dec 18, 2025
051580e
[virtdisk] Simplify get_virtual_disk_info
xmkg Dec 18, 2025
462cad9
[hyperv-vm] Reorder includes
xmkg Dec 18, 2025
4255a58
[hyperv-hcs] Remove unused stuff
xmkg Dec 18, 2025
72e77d1
[hyperv-vm] Use C++20 stuff
xmkg Dec 18, 2025
2d20cb8
[hyperv-vm] Use VM name as log category
xmkg Dec 18, 2025
e8e2e36
[hyperv-vm] Call non-virtual handle_state_update in constr
xmkg Dec 18, 2025
6edbcfd
[hyperv-vm] Change shutdown timeout msg
xmkg Dec 18, 2025
4116816
[hyperv-vm] Remove future FIXMEs/commented out code
xmkg Dec 18, 2025
d24dbdb
[vm] Use common constant for shutdown timeout
xmkg Dec 18, 2025
3fe97a6
[hyperv-vm] Fetch updated state in current_state()
xmkg Dec 18, 2025
1893d39
[hyperv-vm] Mark fetch_state_from_api as const
xmkg Dec 18, 2025
57e631c
[hyperv-tests] Update tests to reflect changes
xmkg Dec 18, 2025
78db805
[hyperv-hcn] Remove unused tags
xmkg Dec 18, 2025
396c1b0
[hyperv-factory] throw if bridge creation fails
xmkg Dec 18, 2025
1f0d6b1
[hyperv-factory] Use specific data dir function
xmkg Dec 18, 2025
e4c5fcd
[hyperv-factory] Handle qprocess exit code better
xmkg Dec 18, 2025
8d8689a
[hyperv-factory] Use find_if in clone_vm_impl
xmkg Dec 18, 2025
b5c8cdb
[platform-win] Move wsa_init_wrapper to shared
xmkg Dec 18, 2025
ef6a67d
[platform-win] Move get_windows_version to shared/
xmkg Dec 18, 2025
bb73c79
[platform-win] Move guid formatter to shared/
xmkg Dec 18, 2025
9730bc1
[hyperv] Refactor narrow/wide string conversion
xmkg Dec 18, 2025
d10f4f0
[hyperv-hcn] Replace stray prototype code with real
xmkg Dec 18, 2025
5823694
[hyperv-api] Simplify JSON formatting even further
xmkg Dec 18, 2025
12cbaf9
[hyperv-api] Unify all json template names
xmkg Dec 18, 2025
14b8e48
[hyperv-tests] Move integration tests to a separate executable
xmkg Jan 7, 2026
79381e0
[gha-wf] Update workflow files after unit/integration split
xmkg Jan 7, 2026
00f7e4e
[hyperv-hcn] Leave logging to caller (create_network)
xmkg Jan 7, 2026
82d5f30
[hyperv-hcs] Move append_if_supported to anon namespace
xmkg Jan 7, 2026
f6c35b6
[hyperv-hcs] Fix a few comment and log nitpicks
xmkg Jan 7, 2026
28060ea
[hyperv-hcs] Use hcs_system_handle from header instead
xmkg Jan 7, 2026
072062a
[hcs-plan9] Apply review suggestions
xmkg Jan 7, 2026
95748e5
[hyperv-hcs] Use HCS_EVENT fwdecl instead of void
xmkg Jan 7, 2026
706bf16
[hyperv-hcs] More nitpick fixes
xmkg Jan 7, 2026
5d2fb57
[hyperv-hcs] Remove default values from derived vcalls
xmkg Jan 7, 2026
e914b0d
[hyperv-hcn] Do not log in open_network. Log levels debug->trace
xmkg Jan 8, 2026
5ebef89
[hyperv-hcs] Move default_ssh_port to constants
xmkg Jan 8, 2026
7e6b182
[hyperv-hcs-vm] Throw if VM open fails
xmkg Jan 8, 2026
86f618a
[hyperv-hcs-vm] Extract create_endpoints and grant_access_to_scsi_device
xmkg Jan 8, 2026
ff7805a
[gha-linux] Change the id for integration tests
xmkg Jan 8, 2026
823e183
[hyperv-hcs-factory] Implement endpoint cleaup upon vm destruction
xmkg Jan 8, 2026
7d6824b
[hyperv] Make the linter happy again
xmkg Jan 8, 2026
3d9bd9f
[hyperv-hcs] Implement hypervisor_health_check
xmkg Jan 8, 2026
e8b2f70
[base-vm] Remove redundant std::views::all()
xmkg Jan 8, 2026
4345ff1
[base-vm] Try to navigate around gcc ranges bug
xmkg Jan 8, 2026
e7bde75
[base-vm] Revert snapshot filtering back to loop
xmkg Jan 12, 2026
c178283
[hyperv-hcs] Add HcsSaveComputeSystem, and mocks.
xmkg Jan 12, 2026
f5f915f
[hyperv-hcs] Add HcsCreateEmpty<Guest|Runtime>StateFile functions
xmkg Jan 12, 2026
9474977
[hyperv-hcs] More work for enabling suspend-to-disk feat.
xmkg Jan 14, 2026
c4f9e2c
[hyperv-hcs] Fix unit tests after changes
xmkg Jan 15, 2026
6b08139
[hyperv-hcs] Fix grant_vm_access not being called for empty state files
xmkg Jan 15, 2026
2ba385b
[tests] Update hyper-v test paths after rebase
xmkg Jan 21, 2026
b2e3be8
[cmake] Fix cmake include paths
xmkg Jan 21, 2026
8b45dca
[hyperv-tests] Update include paths
xmkg Jan 21, 2026
da0a433
[windows-macos] Remove superfluous ccache clear stats
xmkg Jan 21, 2026
c31b178
[gha-linux] Don't fail if instance is already running
xmkg Jan 21, 2026
f9a4bb1
[hyperv-hcs] Implement suspend to disk feature
xmkg Jan 22, 2026
d1c3419
[network-interface] Rename interface to iface
xmkg Mar 2, 2026
c46af78
[hyperv-hcs] Do not ignore guest/runtime state file api call results
xmkg Mar 2, 2026
d964ea8
[multipass/utils] Rename static_bimap to static_bi_map
xmkg Mar 2, 2026
6ef95af
[hyperv-hcs] Apply ricab's suggestion for comment
xmkg Mar 2, 2026
74491a2
[hyperv-hcs] Bump unknown event log severity to warn
xmkg Mar 2, 2026
011c96f
[hyperv-hcs] Apply review suggestions
xmkg Mar 2, 2026
e306167
[hyperv-hcs] Collapse else-if
xmkg Mar 2, 2026
d5ea1d8
[hyperv-hcs] Add state check before shutdown
xmkg Mar 2, 2026
f98b8e8
[hyperv-hcs] Suspend: apply review suggestions
xmkg Mar 2, 2026
60a5e27
[hyperv-hcs] Apply review suggestions to remove_resources_for_impl
xmkg Mar 2, 2026
22967d8
[hyperv-hcs] Throw if disk resize fails
xmkg Mar 2, 2026
5273473
[hyperv-hcs] Fix include order
xmkg Mar 2, 2026
cacc4c9
[hyperv-hcs] Remove "WiFi" from adapters filter
xmkg Mar 2, 2026
390e09e
[virtdisk] Make child to parent merge behavior clearer
xmkg Mar 2, 2026
5b2fb40
[virtdisk] Update doc link
xmkg Mar 2, 2026
d04aa04
[virtdisk] Better encapsulate the predecessor info
xmkg Mar 2, 2026
6fe8a39
[hyperv-hcs] Simplify maybe_create_compute_system
xmkg Mar 9, 2026
9e77851
[hyperv-hcs] Extract set_compute_system_callback_handler
xmkg Mar 9, 2026
ae4ada5
[hyperv-hcs] Extract make_endpoint_parameters
xmkg Mar 9, 2026
a508622
[hyperv-hcs] Remove Plan9 code
xmkg Mar 9, 2026
65fd299
[hyperv-hcs] Remove already created endpoints on failure
xmkg Mar 9, 2026
d4f9dc7
[hyperv-hcs] Remove delete-before-create from try_create_endpoints
xmkg Mar 9, 2026
64efeed
[hyperv-hcn] Introduce enumerate_networks and query_network
xmkg Mar 9, 2026
be95f69
[hyperv-hcn] enumerate_networks now return GUIDs
xmkg Mar 9, 2026
53b8fb1
[hyperv-hcs] Add Hyper-V vSwitches to the network cmd output
xmkg Mar 9, 2026
d8900a1
[hyperv-hcs] Remove redundant network setup code
xmkg Mar 9, 2026
a10cb8d
[hyperv-hcs] Move the feature behind the HYPERV_HCS_ENABLED flag
xmkg Mar 9, 2026
13f869f
[hyperv-hcs] Fix factory create_vm tests after network update
xmkg Mar 9, 2026
e49d2ac
[hyperv-virtdisk] Remove virtdisk snapshot
xmkg Mar 9, 2026
8b8d011
[network-interface] make the linter happy
xmkg Mar 9, 2026
ae968e7
[hyperv-hcn] Make the linter happy
xmkg Mar 9, 2026
59d8865
[cmake] Add HYPERV_HCS_ENABLED definition
xmkg Mar 13, 2026
e32e80a
[hyperv-hcs] Reintroduce delete_endpoint
xmkg Mar 13, 2026
364e5e5
[hyperv-hcs] Re-format files
xmkg Mar 17, 2026
5c39aaa
Revert "[hyperv-virtdisk] Remove virtdisk snapshot"
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 @@ -276,11 +276,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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ packaging/windows/custom-actions/x64/*

# https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html
CMakeUserPresets.json

# clangd cache path
.cache/
**/network-cache
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ if(NOT VCPKG_BUILD_DEFAULT)
set(VCPKG_HOST_TRIPLET "${VCPKG_HOST_ARCH}-${VCPKG_HOST_OS}-release")
set(VCPKG_TARGET_TRIPLET "${VCPKG_HOST_ARCH}-${VCPKG_HOST_OS}-release")
else()
set(VCPKG_HOST_TRIPLET "${VCPKG_HOST_ARCH}-${VCPKG_HOST_OS}")
set(VCPKG_TARGET_TRIPLET "${VCPKG_HOST_ARCH}-${VCPKG_HOST_OS}")
message(NOTICE "Will build `vcpkg` deps in both `debug` and `release` configurations. Be aware that it will take around twice the time to build the `vcpkg` deps.")
endif()

Expand Down Expand Up @@ -229,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 @@ -276,7 +281,12 @@ if(MSVC)
add_definitions(-DLIBSSH_STATIC) # otherwise adds declspec specifiers to libssh apis
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
19 changes: 17 additions & 2 deletions include/multipass/file_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,34 @@ class FileOps : public Singleton<FileOps>
virtual void copy(const fs::path& src,
const fs::path& dist,
fs::copy_options copy_options) const;
virtual bool exists(const fs::path& path, std::error_code& err) 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 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
62 changes: 60 additions & 2 deletions include/multipass/virtual_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
#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>
Expand All @@ -41,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 @@ -74,7 +78,7 @@ class VirtualMachine : private DisabledCopyMove
virtual std::string ssh_hostname()
{
return ssh_hostname(std::chrono::minutes(2));
};
}
virtual std::string ssh_hostname(std::chrono::milliseconds timeout) = 0;
virtual std::string ssh_username() = 0;
virtual std::optional<IPAddress> management_ipv4() = 0;
Expand All @@ -97,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 @@ -130,3 +135,56 @@ class VirtualMachine : private DisabledCopyMove
}
};
} // namespace multipass

/**
* Formatter type specialization for VirtualMachine::State
*/
template <typename Char>
struct fmt::formatter<multipass::VirtualMachine::State, Char>
{
constexpr auto parse(basic_format_parse_context<Char>& ctx)
{
return ctx.begin();
}

template <typename FormatContext>
auto format(multipass::VirtualMachine::State state, FormatContext& ctx) const
{
std::string_view v = "(undefined)";
switch (state)
{
case multipass::VirtualMachine::State::off:
v = "off";
break;
case multipass::VirtualMachine::State::stopped:
v = "stopped";
break;
case multipass::VirtualMachine::State::starting:
v = "starting";
break;
case multipass::VirtualMachine::State::restarting:
v = "restarting";
break;
case multipass::VirtualMachine::State::running:
v = "running";
break;
case multipass::VirtualMachine::State::delayed_shutdown:
v = "delayed_shutdown";
break;
case multipass::VirtualMachine::State::suspending:
v = "suspending";
break;
case multipass::VirtualMachine::State::suspended:
v = "suspended";
break;
case multipass::VirtualMachine::State::unknown:
v = "unknown";
break;
default:
assert(0 && "unhandled VM state");
break;
}

return fmt::format_to(ctx.out(), "{}", v);
}
};
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 @@ -426,7 +426,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
Loading
Loading