mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Include invalid UUID string in ParseUuid err
On-behalf-of: SAP leander.kohler@sap.com Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
This commit is contained in:
committed by
Rob Bradford
parent
8e51c57aea
commit
adfcd17bfc
@@ -33,8 +33,8 @@ pub enum Error {
|
|||||||
#[error("Failure to write additional data to memory")]
|
#[error("Failure to write additional data to memory")]
|
||||||
WriteData,
|
WriteData,
|
||||||
/// Failure to parse uuid, uuid format may be error
|
/// Failure to parse uuid, uuid format may be error
|
||||||
#[error("Failure to parse uuid")]
|
#[error("Failure to parse uuid: {1}")]
|
||||||
ParseUuid(#[source] uuid::Error),
|
ParseUuid(#[source] uuid::Error, String),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type Result<T> = result::Result<T, Error>;
|
pub type Result<T> = result::Result<T, Error>;
|
||||||
@@ -198,7 +198,7 @@ pub fn setup_smbios(
|
|||||||
let uuid_number = uuid
|
let uuid_number = uuid
|
||||||
.map(Uuid::parse_str)
|
.map(Uuid::parse_str)
|
||||||
.transpose()
|
.transpose()
|
||||||
.map_err(Error::ParseUuid)?
|
.map_err(|e| Error::ParseUuid(e, uuid.unwrap().to_string()))?
|
||||||
.unwrap_or(Uuid::nil());
|
.unwrap_or(Uuid::nil());
|
||||||
let smbios_sysinfo = SmbiosSysInfo {
|
let smbios_sysinfo = SmbiosSysInfo {
|
||||||
r#type: SYSTEM_INFORMATION,
|
r#type: SYSTEM_INFORMATION,
|
||||||
|
|||||||
Reference in New Issue
Block a user