diff --git a/.gitignore b/.gitignore index f2e6a65..65b4d06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /virtio-queue-0.1.0.crate /virtio-queue-0.2.0.crate +/virtio-queue-0.3.0.crate diff --git a/rust-virtio-queue.spec b/rust-virtio-queue.spec index 3e18cbb..49e0dae 100644 --- a/rust-virtio-queue.spec +++ b/rust-virtio-queue.spec @@ -5,7 +5,7 @@ %global crate virtio-queue Name: rust-%{crate} -Version: 0.2.0 +Version: 0.3.0 Release: 1%{?dist} Summary: Virtio queue implementation @@ -16,8 +16,12 @@ Source0: %{crates_source} Source1: https://raw.githubusercontent.com/rust-vmm/vm-virtio/main/LICENSE-APACHE Source2: https://raw.githubusercontent.com/rust-vmm/vm-virtio/main/LICENSE-BSD-3-Clause -# virtio-queue is only supported on these arches -ExclusiveArch: x86_64 aarch64 s390x +# Fix tests on s390x +# https://github.com/rust-vmm/vm-virtio/pull/171 +Patch0: virtio-queue-fix-endianess-s390x.diff + +ExclusiveArch: %{rust_arches} +ExcludeArch: i686 BuildRequires: rust-packaging @@ -85,6 +89,11 @@ cp %{SOURCE2} . %endif %changelog +* Wed Jun 01 2022 Sergio Lopez - 0.3.0-1 +- Update to crate version 0.3.0 +- Enable all rust_arches except i686 (32 bits targets are not supported) +- Add a patch fixing a new test broken on s390x + * Thu Mar 10 2022 Sergio Lopez - 0.2.0-1 - Update to crate version 0.2.0 - Drop patch for s390x, as fix has been merged upstream diff --git a/sources b/sources index b2afb90..3e4ee8d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (virtio-queue-0.2.0.crate) = f8255c2e7976b4600a63121b67f99c2607b2be24589ed27b404aac49db7ad44483782cddb4a95f7a48942d755fac92529c4c59d2c5dee65c521d25062f947110 +SHA512 (virtio-queue-0.3.0.crate) = 9d5c27253e0b2cfb4e18d8aca6524be91a855b4c8034e2cdae1af2171c46c7eb6b6b41a39eafc78a5ec6bf2c51e816c150ce53518f5f2aa9c494bf9ff3d9f941 diff --git a/virtio-queue-fix-endianess-s390x.diff b/virtio-queue-fix-endianess-s390x.diff new file mode 100644 index 0000000..c2c6366 --- /dev/null +++ b/virtio-queue-fix-endianess-s390x.diff @@ -0,0 +1,60 @@ +From e498a7ff10df47f9fed3f4a170312a4cf48a7093 Mon Sep 17 00:00:00 2001 +From: Sergio Lopez +Date: Wed, 1 Jun 2022 12:01:39 +0200 +Subject: [PATCH] queue/tests: Add missing endianess conversions + +Add some missing endianess conversions in tests. + +Signed-off-by: Sergio Lopez +--- + crates/virtio-queue/src/queue.rs | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/crates/virtio-queue/src/queue.rs b/crates/virtio-queue/src/queue.rs +index ee97f17..0a3ae64 100644 +--- a/crates/virtio-queue/src/queue.rs ++++ b/crates/virtio-queue/src/queue.rs +@@ -462,16 +462,22 @@ mod tests { + assert_eq!((q.needs_notification().unwrap(), i), (expected, i)); + } + +- m.write_obj::(8, avail_addr.unchecked_add(4 + qsize as u64 * 2)) +- .unwrap(); ++ m.write_obj::( ++ u16::to_le(8), ++ avail_addr.unchecked_add(4 + qsize as u64 * 2), ++ ) ++ .unwrap(); + + // Returns `false` because the current `used_event` value is behind both `next_used` and + // the value of `next_used` at the time when `needs_notification` last returned (which is + // computed based on `num_added` as described in the comments for `needs_notification`. + assert!(!q.needs_notification().unwrap()); + +- m.write_obj::(15, avail_addr.unchecked_add(4 + qsize as u64 * 2)) +- .unwrap(); ++ m.write_obj::( ++ u16::to_le(15), ++ avail_addr.unchecked_add(4 + qsize as u64 * 2), ++ ) ++ .unwrap(); + + q.state.num_added = Wrapping(1); + assert!(!q.needs_notification().unwrap()); +@@ -487,8 +493,11 @@ mod tests { + // Calling `needs_notification` again immediately returns `false`. + assert!(!q.needs_notification().unwrap()); + +- m.write_obj::(u16::MAX - 3, avail_addr.unchecked_add(4 + qsize as u64 * 2)) +- .unwrap(); ++ m.write_obj::( ++ u16::to_le(u16::MAX - 3), ++ avail_addr.unchecked_add(4 + qsize as u64 * 2), ++ ) ++ .unwrap(); + q.state.next_used = Wrapping(u16::MAX - 2); + q.state.num_added = Wrapping(1); + // Returns `true` because, when looking at circular sequence of indices of the used ring, +-- +2.36.1 +