openvmm_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

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

#![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 = "x86_64")]
    serial_debugcon::resolver::SerialDebugconResolver,
    #[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,
    #[cfg(windows)]
    serial_socket::windows::WindowsPipeSerialResolver,
    serial_socket::net::SocketSerialResolver,

    // Network backends
    net_backend::null::NullResolver,
    #[cfg(feature = "net_consomme")]
    net_consomme::resolver::ConsommeResolver,
    #[cfg(all(feature = "net_tap", target_os = "linux"))]
    net_tap::resolver::TapResolver,
    #[cfg(windows)]
    net_dio::resolver::DioResolver,

    // Disks
    disk_layered::resolver::LayeredDiskResolver,
    #[cfg(feature = "disk_crypt")]
    disk_crypt::resolver::DiskCryptResolver,
    disk_file::FileDiskResolver,
    disk_prwrap::DiskWithReservationsResolver,
    disk_vhd1::Vhd1Resolver,
    #[cfg(windows)]
    disk_vhdmp::VhdmpDiskResolver,
    #[cfg(feature = "disk_blob")]
    disk_blob::resolver::BlobDiskResolver,

    // Disk Layers
    disklayer_ram::resolver::RamDiskLayerResolver,
    #[cfg(feature = "disklayer_sqlite")]
    disklayer_sqlite::resolver::SqliteDiskLayerResolver,

    // PCI devices
    gdma::resolver::GdmaDeviceResolver,
    nvme::resolver::NvmeControllerResolver,
    virtio::resolver::VirtioPciResolver,

    // SCSI
    scsidisk::resolver::SimpleScsiResolver,

    // Virtio devices
    #[cfg(any(windows, target_os = "linux"))]
    virtiofs::resolver::VirtioFsResolver,
    #[cfg(any(windows, target_os = "linux"))]
    virtio_p9::resolver::VirtioPlan9Resolver,
    virtio_net::resolver::VirtioNetResolver,
    virtio_pmem::resolver::VirtioPmemResolver,

    // Vmbus devices
    guest_crash_device::resolver::GuestCrashDeviceResolver,
    guest_emulation_device::resolver::GuestEmulationDeviceResolver,
    guest_emulation_log::resolver::GuestEmulationLogResolver,
    hyperv_ic::resolver::IcResolver,
    netvsp::resolver::NetvspResolver,
    storvsp::resolver::StorvspResolver,
    uidevices::resolver::VmbusUiResolver,
    vmbfs::resolver::VmbfsResolver,
    vmbus_serial_host::resolver::VmbusSerialDeviceResolver,
}

// Workers.
mesh_worker::register_workers! {
    hvlite_core::VmWorker,
    vnc_worker::VncWorker<std::net::TcpListener>,

    #[cfg(feature = "gdb")]
    debug_worker::DebuggerWorker<std::net::TcpListener>,
}

/// Call this to ensure the resolvers get linked on macos.
/// <https://github.com/dtolnay/linkme/issues/61>
pub fn ensure_linked_on_macos() {}