From bf059914a6f6d01c829e67d659af02e6e2137bc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 08:47:41 +0000 Subject: [PATCH] build: bump uuid from 0.8.2 to 1.0.0 Bumps [uuid](https://github.com/uuid-rs/uuid) from 0.8.2 to 1.0.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/0.8.2...1.0.0) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- vhdx/Cargo.toml | 2 +- vhdx/src/lib.rs | 5 ++--- vhdx/src/vhdx_header.rs | 2 +- vhdx/src/vhdx_metadata.rs | 2 +- vmm/Cargo.toml | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f03fd89f..44008405a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1069,9 +1069,9 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "uuid" -version = "0.8.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +checksum = "8cfcd319456c4d6ea10087ed423473267e1a071f3bc0aa89f80d60997843c6f0" dependencies = [ "getrandom", ] diff --git a/vhdx/Cargo.toml b/vhdx/Cargo.toml index 8679f528d..c87ecddb8 100644 --- a/vhdx/Cargo.toml +++ b/vhdx/Cargo.toml @@ -12,5 +12,5 @@ libc = "0.2.123" log = "0.4.16" remain = "0.2.2" thiserror = "1.0" -uuid = { version = "0.8.2", features = ["v4"] } +uuid = { version = "1.0.0", features = ["v4"] } vmm-sys-util = ">=0.3.1" \ No newline at end of file diff --git a/vhdx/src/lib.rs b/vhdx/src/lib.rs index e5e8b2cd5..64e171af7 100644 --- a/vhdx/src/lib.rs +++ b/vhdx/src/lib.rs @@ -3,7 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 use byteorder::{BigEndian, ByteOrder}; -use std::result::Result; use uuid::Uuid; macro_rules! div_round_up { @@ -18,7 +17,7 @@ mod vhdx_header; mod vhdx_io; mod vhdx_metadata; -pub(crate) fn uuid_from_guid(buf: &[u8]) -> Result { +pub(crate) fn uuid_from_guid(buf: &[u8]) -> Uuid { // The first 3 fields of UUID are stored in Big Endian format, and // the last 8 bytes are stored as byte array. Therefore, we read the // first 3 fields in Big Endian format instead of Little Endian. @@ -26,6 +25,6 @@ pub(crate) fn uuid_from_guid(buf: &[u8]) -> Result { BigEndian::read_u32(&buf[0..4]), BigEndian::read_u16(&buf[4..6]), BigEndian::read_u16(&buf[6..8]), - &buf[8..16], + buf[8..16].try_into().unwrap(), ) } diff --git a/vhdx/src/vhdx_header.rs b/vhdx/src/vhdx_header.rs index c359e7a91..476067c0d 100644 --- a/vhdx/src/vhdx_header.rs +++ b/vhdx/src/vhdx_header.rs @@ -339,7 +339,7 @@ impl RegionTableEntry { pub fn new(buffer: &[u8]) -> Result { let mut region_table_entry = unsafe { *(buffer.as_ptr() as *mut RegionTableEntry) }; - let uuid = crate::uuid_from_guid(buffer).map_err(VhdxHeaderError::InvalidUuid)?; + let uuid = crate::uuid_from_guid(buffer); region_table_entry.guid = uuid; Ok(region_table_entry) diff --git a/vhdx/src/vhdx_metadata.rs b/vhdx/src/vhdx_metadata.rs index 2f83c55f4..ea5b632b4 100644 --- a/vhdx/src/vhdx_metadata.rs +++ b/vhdx/src/vhdx_metadata.rs @@ -303,7 +303,7 @@ impl MetadataTableEntry { fn new(buffer: &[u8]) -> Result { let mut metadata_table_entry = unsafe { *(buffer.as_ptr() as *mut MetadataTableEntry) }; - let uuid = crate::uuid_from_guid(buffer).map_err(VhdxMetadataError::InvalidUuid)?; + let uuid = crate::uuid_from_guid(buffer); metadata_table_entry.item_id = uuid; if metadata_table_entry.length > METADATA_LENGTH_MAX { diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index 07378d639..4e2de048c 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -43,7 +43,7 @@ serde_derive = "1.0.136" serde_json = "1.0.79" signal-hook = "0.3.13" thiserror = "1.0.30" -uuid = "0.8.2" +uuid = "1.0.0" versionize = "0.1.6" versionize_derive = "0.1.4" vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }