From df3c34e37323b08a022439afda8ebb28fad66cb5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 28 Nov 2022 11:01:41 +0000 Subject: [PATCH] Fix "Input/output error" in journal resolves: rhbz#2148798 --- ...-explicitly-disconnect-from-libvirtd.patch | 39 +++++++++++++++++++ virt-top.spec | 14 +++++-- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 0001-virt-top-fix-to-explicitly-disconnect-from-libvirtd.patch diff --git a/0001-virt-top-fix-to-explicitly-disconnect-from-libvirtd.patch b/0001-virt-top-fix-to-explicitly-disconnect-from-libvirtd.patch new file mode 100644 index 0000000..330091f --- /dev/null +++ b/0001-virt-top-fix-to-explicitly-disconnect-from-libvirtd.patch @@ -0,0 +1,39 @@ +From 4b15ee2440b0e70e3c1eb5e164ded493e2d8f0c8 Mon Sep 17 00:00:00 2001 +From: Yuya Higashi +Date: Tue, 15 Nov 2022 13:56:21 +0900 +Subject: [PATCH] virt-top: fix to explicitly disconnect from libvirtd + +To prevent libvirtd from printing virNetSocketReadWire I/O errors when +the virt-top command exits, explicitly disconnect from libvirtd. + +Signed-off-by: Yuya Higashi +--- + src/top.ml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/top.ml b/src/top.ml +index 75fbcb9..cbe655a 100644 +--- a/src/top.ml ++++ b/src/top.ml +@@ -306,7 +306,7 @@ let get_string maxlen = + ) + + (* Main loop. *) +-let rec main_loop ((_, batch_mode, script_mode, csv_enabled, stream_mode, _, _, _) ++let rec main_loop ((conn, batch_mode, script_mode, csv_enabled, stream_mode, _, _, _) + as setup) = + let csv_flags = !csv_cpu, !csv_mem, !csv_block, !csv_net in + +@@ -372,7 +372,8 @@ let rec main_loop ((_, batch_mode, script_mode, csv_enabled, stream_mode, _, _, + if not !quit || !end_time <> None then + millisleep delay + ) +- done ++ done; ++ C.close conn + + and get_key_press setup delay = + (* Read the next key, waiting up to 'delay' milliseconds. *) +-- +2.31.1 + diff --git a/virt-top.spec b/virt-top.spec index 780b151..e467528 100644 --- a/virt-top.spec +++ b/virt-top.spec @@ -1,7 +1,7 @@ %undefine _package_note_flags Name: virt-top Version: 1.1.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Utility like top(1) for displaying virtualization stats License: GPLv2+ @@ -23,7 +23,10 @@ Source4: libguestfs.keyring # Adds a link to processcsv to the man page. This patch is only # included in RHEL builds. -Patch0: virt-top-1.0.9-processcsv-documentation.patch +Patch1: virt-top-1.0.9-processcsv-documentation.patch + +# Fix "Input/output error" in journal (RHBZ#2148798) +Patch2: 0001-virt-top-fix-to-explicitly-disconnect-from-libvirtd.patch BuildRequires: gcc BuildRequires: make @@ -62,8 +65,9 @@ different virtualization systems. %setup -q %if 0%{?rhel} >= 6 -%patch0 -p1 +%patch1 -p1 %endif +%patch2 -p1 %build @@ -112,6 +116,10 @@ install -m 0644 processcsv.py.1 $RPM_BUILD_ROOT%{_mandir}/man1/ %changelog +* Mon Nov 28 2022 Richard W.M. Jones - 1.1.1-7 +- Fix "Input/output error" in journal + resolves: rhbz#2148798 + * Tue Oct 18 2022 Richard W.M. Jones - 1.1.1-6 - Rebase to virt-top 1.1.1 resolves: rhbz#2135768