import virt-top-1.1.1-9.el9

This commit is contained in:
CentOS Sources 2023-05-09 05:20:01 +00:00 committed by Stepan Oksanichenko
parent c0500f0a21
commit 1dde83e05d
7 changed files with 139 additions and 75 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/virt-top-1.0.9.tar.gz
SOURCES/libguestfs.keyring
SOURCES/virt-top-1.1.1.tar.gz

View File

@ -1 +1,2 @@
95ba1f8d87223ff8e7f341c8c7cb70b59b9d2408 SOURCES/virt-top-1.0.9.tar.gz
1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring
fc97439c120403ef92cbe9d2098a7fc720c02aec SOURCES/virt-top-1.1.1.tar.gz

View File

@ -1,40 +0,0 @@
From 24a461715d5bce47f63cb0097606fc336230589f Mon Sep 17 00:00:00 2001
From: Stephane Glondu <steph@glondu.net>
Date: Wed, 21 Aug 2019 17:24:47 +0200
Subject: [PATCH] libvirt: Handle VIR_DOMAIN_PMSUSPENDED state.
Fixes FTBFS with ocaml-libvirt 0.6.1.5.
RWMJ: Added documentation and changed the letter to 'M'.
---
src/screen.ml | 1 +
src/virt-top.pod | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/src/screen.ml b/src/screen.ml
index 0d847a2..8a66ba6 100644
--- a/src/screen.ml
+++ b/src/screen.ml
@@ -50,3 +50,4 @@ let show_state = function
| D.InfoShutdown -> 'D'
| D.InfoShutoff -> 'O'
| D.InfoCrashed -> 'X'
+ | D.InfoPMSuspended -> 'M'
diff --git a/src/virt-top.pod b/src/virt-top.pod
index 4d81608..76ad3f9 100644
--- a/src/virt-top.pod
+++ b/src/virt-top.pod
@@ -492,6 +492,10 @@ Shutdown.
Crashed.
+=item B<M>
+
+Suspended by guest power management.
+
=back
=item B<TIME>
--
2.22.0

View File

@ -0,0 +1,39 @@
From 4b15ee2440b0e70e3c1eb5e164ded493e2d8f0c8 Mon Sep 17 00:00:00 2001
From: Yuya Higashi <higashi.yuya@fujitsu.com>
Date: Tue, 15 Nov 2022 13:56:21 +0900
Subject: [PATCH 1/2] 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 <higashi.yuya@fujitsu.com>
---
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

View File

@ -0,0 +1,38 @@
From 1d04fdfce6edea685596fbb18920799c70f1d7fa Mon Sep 17 00:00:00 2001
From: Yuya Higashi <higashi.yuya@fujitsu.com>
Date: Mon, 26 Dec 2022 09:18:15 +0900
Subject: [PATCH 2/2] virt-top: fix to parse init-file correctly
This fixes the following runtime error when parsing init-file.
$ virt-top --init-file <(echo "sort id")
Error: Invalid_argument("String.sub / Bytes.sub")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Stdlib__String.sub in file "string.ml" (inlined), line 50, characters 2-23
Called from Utils.split in file "utils.ml", line 82, characters 24-68
Called from Utils.read_config_file.(fun) in file "utils.ml", line 114, characters 23-37
Called from Stdlib__List.map in file "list.ml", line 92, characters 20-23
Called from Top.start_up.try_to_read_init_file in file "top.ml", line 153, characters 17-42
Called from Main.script_mode in file "main.ml", line 37, characters 6-17
Signed-off-by: Yuya Higashi <higashi.yuya@fujitsu.com>
---
src/utils.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils.ml b/src/utils.ml
index 1f00803..8dfb255 100644
--- a/src/utils.ml
+++ b/src/utils.ml
@@ -79,7 +79,7 @@ let trim ?(test = isspace) str =
let split str sep =
try
let i = String.index str sep in
- String.sub str 0 i, String.sub str (i+1) (String.length str - 1)
+ String.sub str 0 i, String.sub str (i+1) (String.length str - i - 1)
with
Not_found -> str, ""
--
2.31.1

View File

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmGC7/kRHHJpY2hAYW5u
ZXhpYS5vcmcACgkQkXOPc+G3aKBOvw/8CNFQqN8GqzWqlKjFd9ditzvu3tcmab9F
ru/qZOKn2RVE7T3vlPYKBIPMKHn9afx31Fvq9ftzPKVejhU7715Jm3uZ/lMgZvJg
PERbKT/ypx5NZYaHx2+uXGzVO600zSnqfnWM3xBguxDxRPqZxYXRSMXiwKHdZNzo
EriDt+By+zBo4PqBhdOFkr9Ppn4PI88170vx3O3PYJt7VGKywvuUoPsflCz4ODIf
8Uo8Wf2wIA6lAZGfnf345ZI99mgycm3eoXYHVxltBiUQxV0J3L0LTWGYP1jkOiYn
8UXfOn02pytgGqI91LAAS0XrcyCjtgmdgUkShwLiWT3CZkkX6wIw1YvPhDNBW46x
k3VRMhO6fckRnmOurbL9TpCObo/9mG7Ol8lVspRKhYgnYV+3V1eaMgXdcL2DpN4O
ueJMjQznmEoejOmyec++bVOmNvae4GgQZT2YsBXfYc3ZT7EMUQXrkcCr5A5BOEyZ
xXuWKFcbDD0XVjxHFZQjYo66eLG8swjPBZb+dUZjAiz0jXrzi2BOF2YJWbLQya+8
zM9ZS1VSaYUX9qmR828bpHn7OqU8fZefL0NsCP8EFcIGQT175PzJ8BO6uYWfmpmp
6nLupdf3YGCHEnCMcPxZ0O4DB1bGZiPU9rvclTbP2uk9YdvBeXkPMDXroV1HDDaB
kkvgVVpdHUI=
=rDgd
-----END PGP SIGNATURE-----

View File

@ -1,9 +1,7 @@
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%global debug_package %{nil}
%undefine _package_note_flags
Name: virt-top
Version: 1.0.9
Release: 21%{?dist}
Version: 1.1.1
Release: 9%{?dist}
Summary: Utility like top(1) for displaying virtualization stats
License: GPLv2+
@ -14,31 +12,34 @@ ExcludeArch: %{power64}
URL: http://people.redhat.com/~rjones/virt-top/
Source0: http://people.redhat.com/~rjones/virt-top/files/%{name}-%{version}.tar.gz
Source1: http://people.redhat.com/~rjones/virt-top/files/%{name}-%{version}.tar.gz.sig
# Post-process output of CSV file (RHBZ#665817, RHBZ#912020).
Source1: processcsv.py
Source2: processcsv.py.pod
Source2: processcsv.py
Source3: processcsv.py.pod
# Keyring used to verify tarball signature.
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
# Upstream patch to fix FTBFS with ocaml libvirt 0.6.1.5.
Patch1: 0001-libvirt-Handle-VIR_DOMAIN_PMSUSPENDED-state.patch
# Fix "Input/output error" in journal (RHBZ#2148798)
Patch2: 0001-virt-top-fix-to-explicitly-disconnect-from-libvirtd.patch
# Fix parse error using --init-file option (RHBZ#2159549)
Patch3: 0002-virt-top-fix-to-parse-init-file-correctly.patch
BuildRequires: gcc
BuildRequires: make
BuildRequires: ocaml >= 3.10.2
BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-findlib-devel
# Need the ncurses / ncursesw (--enable-widec) fix.
BuildRequires: ocaml-curses-devel >= 1.0.3-7
BuildRequires: ocaml-extlib-devel
BuildRequires: ocaml-xml-light-devel
BuildRequires: ocaml-csv-devel
BuildRequires: ocaml-calendar-devel
BuildRequires: ocaml-libvirt-devel >= 0.6.1.5
# Tortuous list of BRs for gettext.
BuildRequires: ocaml-gettext-devel >= 0.3.3
BuildRequires: ocaml-fileutils-devel
# For msgfmt:
@ -46,9 +47,11 @@ BuildRequires: gettext
# Non-OCaml BRs.
BuildRequires: libvirt-devel
BuildRequires: libxml2-devel
BuildRequires: perl-interpreter
BuildRequires: perl(Pod::Perldoc)
BuildRequires: gawk
BuildRequires: gnupg2
%description
@ -61,34 +64,29 @@ different virtualization systems.
%prep
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%setup -q
%if 0%{?rhel} >= 6
%patch0 -p1
%endif
%patch1 -p1
%endif
%patch2 -p1
%patch3 -p1
%build
%configure
make all
%if %opt
make opt
strip src/virt-top.opt
%endif
# Build translations.
make -C po
make
# Force rebuild of man page.
# There is a missing man_MANS rule, will fix upstream in next version.
rm -f src/virt-top.1
make -C src virt-top.1
%if 0%{?rhel} >= 6
# Build processcsv.py.1.
pod2man -c "Virtualization Support" --release "%{name}-%{version}" \
%{SOURCE2} > processcsv.py.1
%{SOURCE3} > processcsv.py.1
%endif
@ -96,17 +94,15 @@ pod2man -c "Virtualization Support" --release "%{name}-%{version}" \
make DESTDIR=$RPM_BUILD_ROOT install
# Install translations.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale
make -C po install PODIR="$RPM_BUILD_ROOT%{_datadir}/locale"
%find_lang %{name}
# Install virt-top manpage by hand for now.
# Install virt-top manpage by hand for now - see above.
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
install -m 0644 src/virt-top.1 $RPM_BUILD_ROOT%{_mandir}/man1
%if 0%{?rhel} >= 6
# Install processcsv.py.
install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
# Install processcsv.py(1).
install -m 0644 processcsv.py.1 $RPM_BUILD_ROOT%{_mandir}/man1/
@ -114,7 +110,7 @@ install -m 0644 processcsv.py.1 $RPM_BUILD_ROOT%{_mandir}/man1/
%files -f %{name}.lang
%doc COPYING README TODO ChangeLog
%doc COPYING README TODO
%{_bindir}/virt-top
%{_mandir}/man1/virt-top.1*
%if 0%{?rhel} >= 6
@ -124,6 +120,18 @@ install -m 0644 processcsv.py.1 $RPM_BUILD_ROOT%{_mandir}/man1/
%changelog
* Tue Jan 10 2023 Richard W.M. Jones <rjones@redhat.com> - 1.1.1-9
- Fix parse error using --init-file option
resolves: rhbz#2159549
* Mon Nov 28 2022 Richard W.M. Jones <rjones@redhat.com> - 1.1.1-7
- Fix "Input/output error" in journal
resolves: rhbz#2148798
* Tue Oct 18 2022 Richard W.M. Jones <rjones@redhat.com> - 1.1.1-6
- Rebase to virt-top 1.1.1
resolves: rhbz#2135768
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.0.9-21
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688