Skip to content

Commit fd9c42c

Browse files
committed
User size-parser in vmm config
1 parent 7aedbde commit fd9c42c

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

size-parser/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl<'de> Deserialize<'de> for MemorySize {
234234

235235
struct MemorySizeVisitor;
236236

237-
impl<'de> Visitor<'de> for MemorySizeVisitor {
237+
impl Visitor<'_> for MemorySizeVisitor {
238238
type Value = MemorySize;
239239

240240
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -344,7 +344,7 @@ pub mod human_size {
344344

345345
struct MemorySizeVisitor<T>(std::marker::PhantomData<T>);
346346

347-
impl<'de, T> Visitor<'de> for MemorySizeVisitor<T>
347+
impl<T> Visitor<'_> for MemorySizeVisitor<T>
348348
where
349349
T: TryFrom<u64>,
350350
T::Error: std::fmt::Display,

vmm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ hex_fmt.workspace = true
4949
lspci.workspace = true
5050
base64.workspace = true
5151
serde-human-bytes.workspace = true
52+
size-parser = { workspace = true, features = ["serde"] }
5253

5354
[dev-dependencies]
5455
insta.workspace = true

vmm/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ pub struct CvmConfig {
193193
/// QEMU qemu_version
194194
pub qemu_version: Option<String>,
195195
/// QEMU pci_hole64_size
196+
#[serde(with = "size_parser::human_size")]
196197
pub qemu_pci_hole64_size: u64,
197198
/// QEMU hotplug_off
198199
pub qemu_hotplug_off: bool,

0 commit comments

Comments
 (0)