* Thu Jun 05 2025 Miroslav Rezanina <mrezanin@redhat.com> - 1.3.0-1
- Rebase to 1.3.0 Resolves: RHEL-73318
This commit is contained in:
parent
893334e56f
commit
0efc8cd386
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,3 +6,5 @@
|
|||||||
/mdevctl-0.78.tar.gz
|
/mdevctl-0.78.tar.gz
|
||||||
/mdevctl-1.1.0.tar.gz
|
/mdevctl-1.1.0.tar.gz
|
||||||
/mdevctl-1.1.0-vendor.tar.gz
|
/mdevctl-1.1.0-vendor.tar.gz
|
||||||
|
/mdevctl-1.3.0-vendor.tar.gz
|
||||||
|
/mdevctl-1.3.0.crate
|
||||||
|
|||||||
@ -1,43 +0,0 @@
|
|||||||
From ff69f6c64b14282172716d4e97b4b81da7606483 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jonathon Jongsma <jjongsma@redhat.com>
|
|
||||||
Date: Wed, 1 Dec 2021 16:37:36 -0600
|
|
||||||
Subject: [PATCH 1/2] Report root error when a callout can't be executed
|
|
||||||
|
|
||||||
We were ignoring the error result when a callout script failed to
|
|
||||||
execute. In order to debug issues more easily, handle the error and
|
|
||||||
print it to the debug output.
|
|
||||||
|
|
||||||
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
|
|
||||||
---
|
|
||||||
src/callouts.rs | 8 ++++----
|
|
||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/callouts.rs b/src/callouts.rs
|
|
||||||
index 1c92d85..17b733b 100644
|
|
||||||
--- a/src/callouts.rs
|
|
||||||
+++ b/src/callouts.rs
|
|
||||||
@@ -240,8 +240,8 @@ impl Callout {
|
|
||||||
for s in dir.as_ref().read_dir().ok()? {
|
|
||||||
let path = s.ok()?.path();
|
|
||||||
|
|
||||||
- match self.invoke_script(dev, &path, event, action).ok() {
|
|
||||||
- Some(res) => {
|
|
||||||
+ match self.invoke_script(dev, &path, event, action) {
|
|
||||||
+ Ok(res) => {
|
|
||||||
if res.status.code().is_none() {
|
|
||||||
warn!("callout script {:?} was terminated by a signal", path);
|
|
||||||
continue;
|
|
||||||
@@ -255,8 +255,8 @@ impl Callout {
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- _ => {
|
|
||||||
- debug!("failed to execute callout script {:?}", path);
|
|
||||||
+ Err(e) => {
|
|
||||||
+ debug!("failed to execute callout script {:?}: {:?}", path, e);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
From 70ba0298a49ccffc085da051ad553a1242f0bfe1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jonathon Jongsma <jjongsma@redhat.com>
|
|
||||||
Date: Wed, 1 Dec 2021 16:39:06 -0600
|
|
||||||
Subject: [PATCH 2/2] tests: read stdin in callout test scripts
|
|
||||||
|
|
||||||
Callout scripts are intended to be passed a JSON device configuration
|
|
||||||
string on stdin. For our simple callout tests, we used single-line
|
|
||||||
test scripts that unconditionally returned a constant response code
|
|
||||||
(either error or success). This sometimes causes the tests to fail due
|
|
||||||
to the following error:
|
|
||||||
|
|
||||||
[2021-12-01T20:33:25Z DEBUG mdevctl::callouts] failed to execute callout script "/tmp/mdevctl-testZg8CPd/etc/mdevctl.d/scripts.d/callouts/rc1.sh": Failed to write to stdin of command
|
|
||||||
|
|
||||||
Caused by:
|
|
||||||
Broken pipe (os error 32)
|
|
||||||
|
|
||||||
What seems to be happening is that mdevctl spawns the callout script and
|
|
||||||
then attempts to write the JSON device configuration to its stdin pipe.
|
|
||||||
However, the test scripts are so short that they may have exited before
|
|
||||||
mdevctl can finish writing to stdin, which results in the command
|
|
||||||
failing with a broken pipe error. In order to avoid this, make sure that
|
|
||||||
the test scripts read from stdin before exiting.
|
|
||||||
|
|
||||||
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
|
|
||||||
---
|
|
||||||
tests/callouts/rc0.sh | 1 +
|
|
||||||
tests/callouts/rc1.sh | 1 +
|
|
||||||
tests/callouts/rc2.sh | 1 +
|
|
||||||
3 files changed, 3 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/tests/callouts/rc0.sh b/tests/callouts/rc0.sh
|
|
||||||
index 039e4d0..669d0ec 100755
|
|
||||||
--- a/tests/callouts/rc0.sh
|
|
||||||
+++ b/tests/callouts/rc0.sh
|
|
||||||
@@ -1,2 +1,3 @@
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
+json=$(</dev/stdin)
|
|
||||||
exit 0
|
|
||||||
diff --git a/tests/callouts/rc1.sh b/tests/callouts/rc1.sh
|
|
||||||
index ecdbef9..3863171 100755
|
|
||||||
--- a/tests/callouts/rc1.sh
|
|
||||||
+++ b/tests/callouts/rc1.sh
|
|
||||||
@@ -1,2 +1,3 @@
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
+json=$(</dev/stdin)
|
|
||||||
exit 1
|
|
||||||
diff --git a/tests/callouts/rc2.sh b/tests/callouts/rc2.sh
|
|
||||||
index 5c66540..f2ec274 100755
|
|
||||||
--- a/tests/callouts/rc2.sh
|
|
||||||
+++ b/tests/callouts/rc2.sh
|
|
||||||
@@ -1,2 +1,3 @@
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
+json=$(</dev/stdin)
|
|
||||||
exit 2
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
--- !Policy
|
--- !Policy
|
||||||
product_versions:
|
product_versions:
|
||||||
- rhel-9
|
- rhel-10
|
||||||
decision_context: osci_compose_gate
|
decision_context: osci_compose_gate
|
||||||
rules:
|
rules:
|
||||||
- !PassingTestCaseRule { test_case_name: osci.brew-build.tier0.functional }
|
- !PassingTestCaseRule { test_case_name: osci.brew-build.tier0.functional }
|
||||||
|
|||||||
66
mdevctl.spec
66
mdevctl.spec
@ -1,27 +1,25 @@
|
|||||||
Name: mdevctl
|
%bcond_without check
|
||||||
Version: 1.1.0
|
|
||||||
Release: 4%{?dist}
|
|
||||||
Summary: Mediated device management and persistence utility
|
|
||||||
|
|
||||||
Group: System Environment/Kernel
|
%global crate mdevctl
|
||||||
License: LGPLv2
|
|
||||||
URL: https://github.com/mdevctl/mdevctl
|
|
||||||
|
|
||||||
Source0: https://github.com/mdevctl/mdevctl/archive/%{version}/%{name}-%{version}.tar.gz
|
Name: mdevctl
|
||||||
Source1: https://github.com/mdevctl/mdevctl/archive/%{version}/%{name}-%{version}-vendor.tar.gz
|
Version: 1.3.0
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: A mediated device management utility for Linux
|
||||||
|
|
||||||
ExclusiveArch: %{rust_arches}
|
License: LGPL-2.1-only
|
||||||
|
URL: https://crates.io/crates/mdevctl
|
||||||
|
Source: %{crates_source}
|
||||||
|
Source1: https://github.com/mdevctl/mdevctl/releases/download/v%{version}/mdevctl-%{version}-vendor.tar.gz
|
||||||
|
|
||||||
BuildRequires: bash
|
BuildRequires: make systemd python3-docutils
|
||||||
BuildRequires: git
|
%if 0%{?rhel}
|
||||||
BuildRequires: make
|
BuildRequires: rust-toolset
|
||||||
BuildRequires: systemd
|
%else
|
||||||
BuildRequires: rust-toolset
|
BuildRequires: rust-packaging >= 21
|
||||||
|
%endif
|
||||||
Requires(post,postun): %{_sbindir}/udevadm
|
Requires(post,postun): %{_sbindir}/udevadm
|
||||||
|
|
||||||
Patch0: 0001-Report-root-error-when-a-callout-can-t-be-executed.patch
|
|
||||||
Patch1: 0002-tests-read-stdin-in-callout-test-scripts.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
mdevctl is a utility for managing and persisting devices in the
|
mdevctl is a utility for managing and persisting devices in the
|
||||||
mediated device device framework of the Linux kernel. Mediated
|
mediated device device framework of the Linux kernel. Mediated
|
||||||
@ -30,34 +28,55 @@ can be dynamically created and potentially used by drivers like
|
|||||||
vfio-mdev for assignment to virtual machines.
|
vfio-mdev for assignment to virtual machines.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -S git_am -n %{name}-%{version}
|
%autosetup -n %{crate}-%{version_no_tilde} -p1 %{?rhel:-a1}
|
||||||
%cargo_prep -V 1
|
%if 0%{?rhel}
|
||||||
|
%cargo_prep -v vendor
|
||||||
|
%else
|
||||||
|
%cargo_prep
|
||||||
|
|
||||||
|
%generate_buildrequires
|
||||||
|
%cargo_generate_buildrequires
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cargo_build
|
%cargo_build
|
||||||
|
%cargo_license_summary
|
||||||
|
%{cargo_license} > LICENSE.dependencies
|
||||||
|
%if 0%{?rhel}
|
||||||
|
%cargo_vendor_manifest
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
|
%if %{with check}
|
||||||
%check
|
%check
|
||||||
export MDEVCTL_LOG=debug RUST_BACKTRACE=full
|
|
||||||
%cargo_test
|
%cargo_test
|
||||||
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license COPYING
|
%license COPYING
|
||||||
|
%license LICENSE.dependencies
|
||||||
|
%if 0%{?rhel}
|
||||||
|
%license cargo-vendor.txt
|
||||||
|
%endif
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%{_sbindir}/mdevctl
|
%{_sbindir}/mdevctl
|
||||||
%{_sbindir}/lsmdev
|
%{_sbindir}/lsmdev
|
||||||
%{_udevrulesdir}/60-mdevctl.rules
|
%{_udevrulesdir}/60-mdevctl.rules
|
||||||
%dir %{_sysconfdir}/mdevctl.d
|
%dir %{_sysconfdir}/mdevctl.d
|
||||||
%dir %{_sysconfdir}/mdevctl.d/scripts.d/callouts
|
%dir %{_prefix}/lib/mdevctl/scripts.d/callouts
|
||||||
%dir %{_sysconfdir}/mdevctl.d/scripts.d/notifiers
|
%dir %{_prefix}/lib/mdevctl/scripts.d/notifiers
|
||||||
%{_mandir}/man8/mdevctl.8*
|
%{_mandir}/man8/mdevctl.8*
|
||||||
%{_mandir}/man8/lsmdev.8*
|
%{_mandir}/man8/lsmdev.8*
|
||||||
%{_datadir}/bash-completion/completions/mdevctl
|
%{_datadir}/bash-completion/completions/mdevctl
|
||||||
%{_datadir}/bash-completion/completions/lsmdev
|
%{_datadir}/bash-completion/completions/lsmdev
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jun 05 2025 Miroslav Rezanina <mrezanin@redhat.com> - 1.3.0-1
|
||||||
|
- Rebase to 1.3.0
|
||||||
|
Resolves: RHEL-73318
|
||||||
|
|
||||||
* Thu Jan 20 2022 Jonathon Jongsma <jjongsma@redhat.com> - 1.1.0-4
|
* Thu Jan 20 2022 Jonathon Jongsma <jjongsma@redhat.com> - 1.1.0-4
|
||||||
- fix gating.yaml indentation and rebuild
|
- fix gating.yaml indentation and rebuild
|
||||||
|
|
||||||
@ -83,7 +102,6 @@ export MDEVCTL_LOG=debug RUST_BACKTRACE=full
|
|||||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.78-2
|
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.78-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
|
||||||
* Tue Nov 24 2020 Alex Williamson <alex.williamson@redhat.com> - 0.78-1
|
* Tue Nov 24 2020 Alex Williamson <alex.williamson@redhat.com> - 0.78-1
|
||||||
- e029640033d3 ("Automatic version commit for tag 0.78")
|
- e029640033d3 ("Automatic version commit for tag 0.78")
|
||||||
- e32f506656fd ("use standard bash path")
|
- e32f506656fd ("use standard bash path")
|
||||||
|
|||||||
4
sources
4
sources
@ -1,2 +1,2 @@
|
|||||||
SHA512 (mdevctl-1.1.0.tar.gz) = f1fa3503a24baafa1377b2a209d85a3d112845c339a40c4db53478d61fd4bd671ee9975c025802a0097d87aab4ed72c8ce910c5dde3f215d4e97d584d10d024c
|
SHA512 (mdevctl-1.3.0-vendor.tar.gz) = 7a42887ced3e473793819948e49b79e1c6797544fb347b97f280cd55824b17337ff28a10cfa18426533719640b7de926841c1720294db9b7bde759404abd41c0
|
||||||
SHA512 (mdevctl-1.1.0-vendor.tar.gz) = f573b43e36550ac132dae802217fe7eeeb381d5af155a51ddedc0e2a6f2b59cd2616b9dcae9002c7d134051c8907756e338de037b5018c5a7e9a7d01191cc3ab
|
SHA512 (mdevctl-1.3.0.crate) = 15db62434137fa0c776117e31b0a5a68ac2153204633532545e65b659798c27cec357de698549fabfc55660f6ea86799eb3a8fadb101e5294513c68c8ac50792
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user