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
use xencall::sys::CreateDomain;

use crate::{
    boot::{BootDomain, BootSetupPlatform, DomainSegment},
    error::Result,
};

#[derive(Default, Clone)]
pub struct UnsupportedPlatform;

impl UnsupportedPlatform {
    pub fn new() -> Self {
        Self {}
    }
}

#[async_trait::async_trait]
impl BootSetupPlatform for UnsupportedPlatform {
    fn create_domain(&self, _: bool) -> CreateDomain {
        panic!("unsupported platform")
    }

    fn page_size(&self) -> u64 {
        panic!("unsupported platform")
    }

    fn page_shift(&self) -> u64 {
        panic!("unsupported platform")
    }

    fn needs_early_kernel(&self) -> bool {
        panic!("unsupported platform")
    }

    fn hvm(&self) -> bool {
        panic!("unsupported platform")
    }

    async fn initialize_early(&mut self, _: &mut BootDomain) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn initialize_memory(&mut self, _: &mut BootDomain) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn alloc_p2m_segment(&mut self, _: &mut BootDomain) -> Result<Option<DomainSegment>> {
        panic!("unsupported platform")
    }

    async fn alloc_page_tables(&mut self, _: &mut BootDomain) -> Result<Option<DomainSegment>> {
        panic!("unsupported platform")
    }

    async fn setup_page_tables(&mut self, _: &mut BootDomain) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn setup_hypercall_page(&mut self, _: &mut BootDomain) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn alloc_magic_pages(&mut self, _: &mut BootDomain) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn setup_shared_info(&mut self, _: &mut BootDomain, _: u64) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn setup_start_info(&mut self, _: &mut BootDomain, _: u64) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn bootlate(&mut self, _: &mut BootDomain) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn vcpu(&mut self, _: &mut BootDomain) -> Result<()> {
        panic!("unsupported platform")
    }

    async fn gnttab_seed(&mut self, _: &mut BootDomain) -> Result<()> {
        panic!("unsupported platform")
    }
}