From 0ff84bba49eceba6cc78a44cbb887236e17672e6 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 30 Jul 2024 17:58:27 +0100 Subject: [PATCH 1/6] Update dependencies. --- Cargo.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c0ea8214..fb6453bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,14 +15,14 @@ keywords = ["virtio"] categories = ["hardware-support", "no-std"] [dependencies] -log = "0.4" -bitflags = "2.3.0" -enumn = "0.1.13" -zerocopy = { version = "0.7.5", features = ["derive"] } +log = "0.4.22" +bitflags = "2.6.0" +enumn = "0.1.14" +zerocopy = { version = "0.7.35", features = ["derive"] } [features] default = ["alloc"] alloc = ["zerocopy/alloc"] [dev-dependencies] -zerocopy = { version = "0.7.5", features = ["alloc"] } +zerocopy = { version = "0.7.35", features = ["alloc"] } From e609accf934599a60789ebaebd7aa3431cbfc698 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 30 Jul 2024 17:59:13 +0100 Subject: [PATCH 2/6] Update to 2021 edition. --- Cargo.toml | 2 +- examples/riscv/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fb6453bd..75cf0717 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = [ "Yuekai Jia ", "Andrew Walbran ", ] -edition = "2018" +edition = "2021" description = "VirtIO guest drivers." repository = "https://github.com/rcore-os/virtio-drivers" keywords = ["virtio"] diff --git a/examples/riscv/Cargo.toml b/examples/riscv/Cargo.toml index 0d0c9fc7..26d5d313 100644 --- a/examples/riscv/Cargo.toml +++ b/examples/riscv/Cargo.toml @@ -2,7 +2,7 @@ name = "riscv" version = "0.1.0" authors = ["Runji Wang "] -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 35c732e18f5aeb5eb938efca0a800683d0c6bf8a Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 30 Jul 2024 18:00:27 +0100 Subject: [PATCH 3/6] Remove excess logs. --- src/device/sound.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/device/sound.rs b/src/device/sound.rs index e8fa1f95..571a55a5 100644 --- a/src/device/sound.rs +++ b/src/device/sound.rs @@ -530,14 +530,12 @@ impl VirtIOSound { if self.tx_queue.should_notify() { self.transport.notify(TX_QUEUE_IDX); } - info!("Added buffer, head = {}, token = {}", head, tokens[head]); buffers[head] = Some(buffer); head += 1; if head >= usize::from(QUEUE_SIZE) { head = 0; } } else if head == tail { - info!("head = {head}, tail = {tail}, breaking"); break; } } @@ -549,7 +547,6 @@ impl VirtIOSound { &mut [statuses[tail].as_bytes_mut()], )?; } - info!("Popped buffer, tail = {}, token = {}", tail, tokens[tail]); if statuses[tail].status != CommandCode::SOk.into() { return Err(Error::IoError); } From 2d5acb051ecc6db992f4a120130b8ff0baeb8f59 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 30 Jul 2024 18:01:38 +0100 Subject: [PATCH 4/6] Fix clippy lint warnings. --- examples/riscv/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/riscv/src/main.rs b/examples/riscv/src/main.rs index 45616293..dc54314e 100644 --- a/examples/riscv/src/main.rs +++ b/examples/riscv/src/main.rs @@ -186,7 +186,7 @@ fn virtio_sound(transport: T) { let mut sound = VirtIOSound::::new(transport).expect("failed to create sound driver"); let output_streams = sound.output_streams().unwrap(); - if output_streams.len() > 0 { + if !output_streams.is_empty() { let output_stream_id = *output_streams.first().unwrap(); let rates = sound.rates_supported(output_stream_id).unwrap(); let formats = sound.formats_supported(output_stream_id).unwrap(); @@ -204,7 +204,7 @@ fn virtio_sound(transport: T) { PcmFormat::U32 }; let channel = if channel_range.contains(&2) { - 2 as u8 + 2 } else { *channel_range.start() }; From 1c49c5c57330946cba59d794d11089b4f90826e3 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 30 Jul 2024 18:03:59 +0100 Subject: [PATCH 5/6] Rename config files to avoid warning. --- examples/aarch64/.cargo/{config => config.toml} | 0 examples/riscv/.cargo/{config => config.toml} | 0 examples/x86_64/.cargo/{config => config.toml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename examples/aarch64/.cargo/{config => config.toml} (100%) rename examples/riscv/.cargo/{config => config.toml} (100%) rename examples/x86_64/.cargo/{config => config.toml} (100%) diff --git a/examples/aarch64/.cargo/config b/examples/aarch64/.cargo/config.toml similarity index 100% rename from examples/aarch64/.cargo/config rename to examples/aarch64/.cargo/config.toml diff --git a/examples/riscv/.cargo/config b/examples/riscv/.cargo/config.toml similarity index 100% rename from examples/riscv/.cargo/config rename to examples/riscv/.cargo/config.toml diff --git a/examples/x86_64/.cargo/config b/examples/x86_64/.cargo/config.toml similarity index 100% rename from examples/x86_64/.cargo/config rename to examples/x86_64/.cargo/config.toml From e1129655e6a5642cabe29541387d7e366b6f6c73 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 30 Jul 2024 18:04:29 +0100 Subject: [PATCH 6/6] Prepare for 0.7.5 release. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 75cf0717..a51150d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "virtio-drivers" -version = "0.7.4" +version = "0.7.5" license = "MIT" authors = [ "Jiajie Chen ",