openvmm_hcl_resources/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![cfg_attr(not(target_os = "linux"), expect(missing_docs))]
#![cfg(target_os = "linux")]

//! The [`vm_resource`] resources and [`mesh_worker`] workers that are available
//! in OpenVMM-HCL.

#![forbid(unsafe_code)]

// Resources.
vm_resource::register_static_resolvers! {
    // Chipset devices
    #[cfg(guest_arch = "x86_64")]
    chipset::i8042::resolver::I8042Resolver,
    missing_dev::resolver::MissingDevResolver,
    #[cfg(feature = "tpm")]
    tpm::resolver::TpmDeviceResolver,
    #[cfg(guest_arch = "x86_64")]
    serial_16550::resolver::Serial16550Resolver,
    #[cfg(guest_arch = "aarch64")]
    serial_pl011::resolver::SerialPl011Resolver,
    chipset::battery::resolver::BatteryResolver,

    // Non-volatile stores
    vmcore::non_volatile_store::resources::EphemeralNonVolatileStoreResolver,

    // Serial ports
    serial_core::disconnected::resolver::DisconnectedSerialBackendResolver,
    vmbus_serial_guest::VmbusSerialGuestResolver,

    // Disks.
    //
    // `BlockDevice` and `NvmeDisk` are registered dynamically since they have
    // runtime dependencies.
    disk_striped::StripedDiskResolver,

    // SCSI
    scsidisk::resolver::SimpleScsiResolver,

    // Vmbus devices
    hyperv_ic::resolver::IcResolver,
    storvsp::resolver::StorvspResolver,
    #[cfg(feature = "uidevices")]
    uidevices::resolver::VmbusUiResolver,

    // VPCI devices
    #[cfg(feature = "nvme")]
    nvme::resolver::NvmeControllerResolver,
}

// Mesh workers.
mesh_worker::register_workers! {
    #[cfg(feature = "vnc_worker")]
    vnc_worker::VncWorker<vmsocket::VmListener>,
    #[cfg(feature = "debug_worker")]
    debug_worker::DebuggerWorker<vmsocket::VmListener>,
}