This commit is contained in:
		@@ -22,10 +22,13 @@ pub struct DomainMetadataXML {
 | 
				
			|||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
 | 
					#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
 | 
				
			||||||
#[serde(rename = "os")]
 | 
					#[serde(rename = "os")]
 | 
				
			||||||
pub struct OSXML {
 | 
					pub struct OSXML {
 | 
				
			||||||
    #[serde(rename = "@firmware", default)]
 | 
					    #[serde(rename = "@firmware", default, skip_serializing_if = "Option::is_none")]
 | 
				
			||||||
    pub firmware: String,
 | 
					    pub firmware: Option<String>,
 | 
				
			||||||
    pub r#type: OSTypeXML,
 | 
					    pub r#type: OSTypeXML,
 | 
				
			||||||
 | 
					    #[serde(skip_serializing_if = "Option::is_none")]
 | 
				
			||||||
    pub loader: Option<OSLoaderXML>,
 | 
					    pub loader: Option<OSLoaderXML>,
 | 
				
			||||||
 | 
					    #[serde(skip_serializing_if = "Option::is_none")]
 | 
				
			||||||
 | 
					    pub bootmenu: Option<OSBootMenuXML>,
 | 
				
			||||||
    pub smbios: Option<OSSMBiosXML>,
 | 
					    pub smbios: Option<OSSMBiosXML>,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -49,6 +52,16 @@ pub struct OSLoaderXML {
 | 
				
			|||||||
    pub secure: String,
 | 
					    pub secure: String,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// Legacy boot menu information
 | 
				
			||||||
 | 
					#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
 | 
				
			||||||
 | 
					#[serde(rename = "bootmenu")]
 | 
				
			||||||
 | 
					pub struct OSBootMenuXML {
 | 
				
			||||||
 | 
					    #[serde(rename = "@enable")]
 | 
				
			||||||
 | 
					    pub enable: String,
 | 
				
			||||||
 | 
					    #[serde(rename = "@timeout")]
 | 
				
			||||||
 | 
					    pub timeout: usize,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// SMBIOS System information
 | 
					/// SMBIOS System information
 | 
				
			||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
 | 
					#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
 | 
				
			||||||
#[serde(rename = "smbios")]
 | 
					#[serde(rename = "smbios")]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ pub struct VMGroupId(pub String);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#[derive(serde::Serialize, serde::Deserialize)]
 | 
					#[derive(serde::Serialize, serde::Deserialize)]
 | 
				
			||||||
pub enum BootType {
 | 
					pub enum BootType {
 | 
				
			||||||
 | 
					    Legacy,
 | 
				
			||||||
    UEFI,
 | 
					    UEFI,
 | 
				
			||||||
    UEFISecureBoot,
 | 
					    UEFISecureBoot,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -351,13 +352,26 @@ impl VMInfo {
 | 
				
			|||||||
                    machine: "q35".to_string(),
 | 
					                    machine: "q35".to_string(),
 | 
				
			||||||
                    body: "hvm".to_string(),
 | 
					                    body: "hvm".to_string(),
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                firmware: "efi".to_string(),
 | 
					                firmware: match self.boot_type {
 | 
				
			||||||
                loader: Some(OSLoaderXML {
 | 
					                    BootType::Legacy => None,
 | 
				
			||||||
                    secure: match self.boot_type {
 | 
					                    _ => Some("efi".to_string()),
 | 
				
			||||||
                        BootType::UEFI => "no".to_string(),
 | 
					                },
 | 
				
			||||||
                        BootType::UEFISecureBoot => "yes".to_string(),
 | 
					                loader: match self.boot_type {
 | 
				
			||||||
                    },
 | 
					                    BootType::Legacy => None,
 | 
				
			||||||
                }),
 | 
					                    _ => Some(OSLoaderXML {
 | 
				
			||||||
 | 
					                        secure: match self.boot_type {
 | 
				
			||||||
 | 
					                            BootType::UEFISecureBoot => "yes".to_string(),
 | 
				
			||||||
 | 
					                            _ => "no".to_string(),
 | 
				
			||||||
 | 
					                        },
 | 
				
			||||||
 | 
					                    }),
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                bootmenu: match self.boot_type {
 | 
				
			||||||
 | 
					                    BootType::Legacy => Some(OSBootMenuXML {
 | 
				
			||||||
 | 
					                        enable: "yes".to_string(),
 | 
				
			||||||
 | 
					                        timeout: 3000,
 | 
				
			||||||
 | 
					                    }),
 | 
				
			||||||
 | 
					                    _ => None,
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
                smbios: Some(OSSMBiosXML {
 | 
					                smbios: Some(OSSMBiosXML {
 | 
				
			||||||
                    mode: "sysinfo".to_string(),
 | 
					                    mode: "sysinfo".to_string(),
 | 
				
			||||||
                }),
 | 
					                }),
 | 
				
			||||||
@@ -449,9 +463,10 @@ impl VMInfo {
 | 
				
			|||||||
                .virtweb
 | 
					                .virtweb
 | 
				
			||||||
                .group
 | 
					                .group
 | 
				
			||||||
                .map(VMGroupId),
 | 
					                .map(VMGroupId),
 | 
				
			||||||
            boot_type: match domain.os.loader {
 | 
					            boot_type: match (domain.os.loader, domain.os.bootmenu) {
 | 
				
			||||||
                None => BootType::UEFI,
 | 
					                (_, Some(_)) => BootType::Legacy,
 | 
				
			||||||
                Some(l) => match l.secure.as_str() {
 | 
					                (None, _) => BootType::UEFI,
 | 
				
			||||||
 | 
					                (Some(l), _) => match l.secure.as_str() {
 | 
				
			||||||
                    "yes" => BootType::UEFISecureBoot,
 | 
					                    "yes" => BootType::UEFISecureBoot,
 | 
				
			||||||
                    _ => BootType::UEFI,
 | 
					                    _ => BootType::UEFI,
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -82,6 +82,8 @@ export interface VMNetBridge {
 | 
				
			|||||||
  bridge: string;
 | 
					  bridge: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type VMBootType = "UEFI" | "UEFISecureBoot" | "Legacy";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface VMInfoInterface {
 | 
					interface VMInfoInterface {
 | 
				
			||||||
  name: string;
 | 
					  name: string;
 | 
				
			||||||
  uuid?: string;
 | 
					  uuid?: string;
 | 
				
			||||||
@@ -89,7 +91,7 @@ interface VMInfoInterface {
 | 
				
			|||||||
  title?: string;
 | 
					  title?: string;
 | 
				
			||||||
  description?: string;
 | 
					  description?: string;
 | 
				
			||||||
  group?: string;
 | 
					  group?: string;
 | 
				
			||||||
  boot_type: "UEFI" | "UEFISecureBoot";
 | 
					  boot_type: VMBootType;
 | 
				
			||||||
  architecture: "i686" | "x86_64";
 | 
					  architecture: "i686" | "x86_64";
 | 
				
			||||||
  memory: number;
 | 
					  memory: number;
 | 
				
			||||||
  number_vcpu: number;
 | 
					  number_vcpu: number;
 | 
				
			||||||
@@ -108,7 +110,7 @@ export class VMInfo implements VMInfoInterface {
 | 
				
			|||||||
  title?: string;
 | 
					  title?: string;
 | 
				
			||||||
  description?: string;
 | 
					  description?: string;
 | 
				
			||||||
  group?: string;
 | 
					  group?: string;
 | 
				
			||||||
  boot_type: "UEFI" | "UEFISecureBoot";
 | 
					  boot_type: VMBootType;
 | 
				
			||||||
  architecture: "i686" | "x86_64";
 | 
					  architecture: "i686" | "x86_64";
 | 
				
			||||||
  number_vcpu: number;
 | 
					  number_vcpu: number;
 | 
				
			||||||
  memory: number;
 | 
					  memory: number;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -280,6 +280,7 @@ function VMDetailsTabGeneral(p: DetailsInnerProps): React.ReactElement {
 | 
				
			|||||||
          options={[
 | 
					          options={[
 | 
				
			||||||
            { label: "UEFI with Secure Boot", value: "UEFISecureBoot" },
 | 
					            { label: "UEFI with Secure Boot", value: "UEFISecureBoot" },
 | 
				
			||||||
            { label: "UEFI", value: "UEFI" },
 | 
					            { label: "UEFI", value: "UEFI" },
 | 
				
			||||||
 | 
					            { label: "Legacy", value: "Legacy" },
 | 
				
			||||||
          ]}
 | 
					          ]}
 | 
				
			||||||
        />
 | 
					        />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user