summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Glondu <steph@glondu.net>2023-09-09 09:48:26 +0200
committerStephane Glondu <steph@glondu.net>2023-09-09 09:48:26 +0200
commit3637c9f8e3b74d4bbe3f911fa36b9345589f9edf (patch)
tree967ccb99df56011b9d044d88929adf1fc7c2cfa8
parent84ab9bd860568970f1c2a69c80434614fb929d5d (diff)
New upstream version 1.1.1
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in10
-rw-r--r--README6
-rw-r--r--aclocal.m4344
-rwxr-xr-xconfigure360
-rw-r--r--configure.ac14
-rwxr-xr-xocaml-dep.sh.in10
-rw-r--r--po/LINGUAS3
-rw-r--r--po/Makefile.in8
-rw-r--r--po/POTFILES2
-rw-r--r--po/POTFILES-ml3
-rw-r--r--po/cs.gmobin7955 -> 8038 bytes
-rw-r--r--po/cs.po15
-rw-r--r--po/es.gmobin7224 -> 8099 bytes
-rw-r--r--po/es.po25
-rw-r--r--po/fi.gmobin0 -> 7792 bytes
-rw-r--r--po/fi.po376
-rw-r--r--po/id.gmobin7392 -> 7534 bytes
-rw-r--r--po/id.po21
-rw-r--r--po/nl.gmobin5648 -> 7626 bytes
-rw-r--r--po/nl.po46
-rw-r--r--po/si.gmobin0 -> 515 bytes
-rw-r--r--po/si.po355
-rw-r--r--po/virt-top.pot152
-rw-r--r--src/.depend20
-rw-r--r--src/Makefile.am30
-rw-r--r--src/Makefile.in82
-rw-r--r--src/README17
-rw-r--r--src/collect.ml356
-rw-r--r--src/collect.mli4
-rw-r--r--src/csv_output.ml102
-rw-r--r--src/csv_output.mli5
-rw-r--r--src/dummy.c2
-rw-r--r--src/opt_calendar.ml8
-rw-r--r--src/opt_xml.ml69
-rw-r--r--src/redraw.ml9
-rw-r--r--src/stream_output.ml3
-rw-r--r--src/top.ml9
-rw-r--r--src/top.mli3
-rw-r--r--src/utils.ml23
-rw-r--r--src/utils.mli6
-rw-r--r--src/version.ml2
-rw-r--r--src/virt-top.pod4
-rw-r--r--src/xml-c.c124
-rw-r--r--src/xml.ml (renamed from src/opt_csv.ml)32
45 files changed, 1997 insertions, 665 deletions
diff --git a/Makefile.am b/Makefile.am
index 3f1a485..51530c7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ maintainer-commit:
# Tag HEAD with current version (only for maintainer).
maintainer-tag:
- git tag -a "v$(VERSION)" -m "Version $(VERSION) ($(BRANCH_TYPE))" -f
+ git tag -a "v$(VERSION)" -m "Version $(VERSION)" -f
# Maintainer only: check no files are missing from EXTRA_DIST rules,
# and that all generated files have been included in the tarball.
diff --git a/Makefile.in b/Makefile.in
index a875de1..0116aff 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -258,6 +258,8 @@ LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
@@ -284,13 +286,10 @@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@
OCAMLVERSION = @OCAMLVERSION@
OCAML_GETTEXT = @OCAML_GETTEXT@
OCAML_PKG_calendar = @OCAML_PKG_calendar@
-OCAML_PKG_csv = @OCAML_PKG_csv@
OCAML_PKG_curses = @OCAML_PKG_curses@
-OCAML_PKG_extlib = @OCAML_PKG_extlib@
OCAML_PKG_gettext = @OCAML_PKG_gettext@
OCAML_PKG_libvirt = @OCAML_PKG_libvirt@
OCAML_PKG_unix = @OCAML_PKG_unix@
-OCAML_PKG_xml_light = @OCAML_PKG_xml_light@
OCAML_RUNTIME_VARIANT_PIC_OPTION = @OCAML_RUNTIME_VARIANT_PIC_OPTION@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -300,6 +299,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -879,7 +881,7 @@ maintainer-commit:
# Tag HEAD with current version (only for maintainer).
maintainer-tag:
- git tag -a "v$(VERSION)" -m "Version $(VERSION) ($(BRANCH_TYPE))" -f
+ git tag -a "v$(VERSION)" -m "Version $(VERSION)" -f
# Maintainer only: check no files are missing from EXTRA_DIST rules,
# and that all generated files have been included in the tarball.
diff --git a/README b/README
index d97fa62..da72740 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
virt-top
----------------------------------------------------------------------
-Copyright (C) 2007-2016 Richard W.M. Jones, Red Hat Inc.
+Copyright (C) 2007-2021 Richard W.M. Jones, Red Hat Inc.
http://et.redhat.com/~rjones/virt-top/
http://libvirt.org/ocaml/
http://libvirt.org/
@@ -19,13 +19,11 @@ Requirements
OCaml >= 3.11.0
ocaml-libvirt >= 0.6.1.1 (for virDomainGetCPUStats support)
-OCaml extlib
OCaml curses
+libxml2
Optional:
OCaml gettext
-OCaml xml-light
-OCaml CSV
OCaml Calendar, version 2 is preferred
perldoc
msgfmt
diff --git a/aclocal.m4 b/aclocal.m4
index 1bb109c..9f15dfd 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -2762,6 +2762,350 @@ AC_DEFUN([AM_NLS],
AC_SUBST([USE_NLS])
])
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 11 (pkg-config-0.29.1)
+
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+
+dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
+dnl [DESCRIPTION], [DEFAULT])
+dnl ------------------------------------------
+dnl
+dnl Prepare a "--with-" configure option using the lowercase
+dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
+dnl PKG_CHECK_MODULES in a single macro.
+AC_DEFUN([PKG_WITH_MODULES],
+[
+m4_pushdef([with_arg], m4_tolower([$1]))
+
+m4_pushdef([description],
+ [m4_default([$5], [build with ]with_arg[ support])])
+
+m4_pushdef([def_arg], [m4_default([$6], [auto])])
+m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
+m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
+
+m4_case(def_arg,
+ [yes],[m4_pushdef([with_without], [--without-]with_arg)],
+ [m4_pushdef([with_without],[--with-]with_arg)])
+
+AC_ARG_WITH(with_arg,
+ AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
+ [AS_TR_SH([with_]with_arg)=def_arg])
+
+AS_CASE([$AS_TR_SH([with_]with_arg)],
+ [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
+ [auto],[PKG_CHECK_MODULES([$1],[$2],
+ [m4_n([def_action_if_found]) $3],
+ [m4_n([def_action_if_not_found]) $4])])
+
+m4_popdef([with_arg])
+m4_popdef([description])
+m4_popdef([def_arg])
+
+])dnl PKG_WITH_MODULES
+
+dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [DESCRIPTION], [DEFAULT])
+dnl -----------------------------------------------
+dnl
+dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
+dnl check._[VARIABLE-PREFIX] is exported as make variable.
+AC_DEFUN([PKG_HAVE_WITH_MODULES],
+[
+PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
+
+AM_CONDITIONAL([HAVE_][$1],
+ [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
+])dnl PKG_HAVE_WITH_MODULES
+
+dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [DESCRIPTION], [DEFAULT])
+dnl ------------------------------------------------------
+dnl
+dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
+dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
+dnl and preprocessor variable.
+AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
+[
+PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
+
+AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
+ [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
+])dnl PKG_HAVE_DEFINE_WITH_MODULES
+
# po.m4 serial 31 (gettext-0.20.2)
dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
diff --git a/configure b/configure
index aff6d79..4b36e16 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for virt-top 1.1.0.
+# Generated by GNU Autoconf 2.69 for virt-top 1.1.1.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='virt-top'
PACKAGE_TARNAME='virt-top'
-PACKAGE_VERSION='1.1.0'
-PACKAGE_STRING='virt-top 1.1.0'
+PACKAGE_VERSION='1.1.1'
+PACKAGE_STRING='virt-top 1.1.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -659,21 +659,14 @@ HAVE_PERLDOC_FALSE
HAVE_PERLDOC_TRUE
HAVE_PERLDOC
OCAML_RUNTIME_VARIANT_PIC_OPTION
-HAVE_PKG_XML_LIGHT_FALSE
-HAVE_PKG_XML_LIGHT_TRUE
HAVE_PKG_GETTEXT_FALSE
HAVE_PKG_GETTEXT_TRUE
-HAVE_PKG_CSV_FALSE
-HAVE_PKG_CSV_TRUE
HAVE_PKG_CALENDAR_FALSE
HAVE_PKG_CALENDAR_TRUE
-OCAML_PKG_xml_light
OCAML_PKG_gettext
-OCAML_PKG_csv
OCAML_PKG_calendar
OCAML_PKG_curses
OCAML_PKG_libvirt
-OCAML_PKG_extlib
OCAML_PKG_unix
OCAMLFIND
HAVE_OCAMLOPT_FALSE
@@ -691,6 +684,11 @@ OCAMLOPT
OCAMLLIB
OCAMLVERSION
OCAMLC
+LIBXML2_LIBS
+LIBXML2_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
EGREP
GREP
CPP
@@ -797,7 +795,12 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-CPP'
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+LIBXML2_CFLAGS
+LIBXML2_LIBS'
# Initialize some variables set by options.
@@ -1348,7 +1351,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures virt-top 1.1.0 to adapt to many kinds of systems.
+\`configure' configures virt-top 1.1.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1419,7 +1422,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of virt-top 1.1.0:";;
+ short | recursive ) echo "Configuration of virt-top 1.1.1:";;
esac
cat <<\_ACEOF
@@ -1455,6 +1458,15 @@ Some influential environment variables:
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
+ PKG_CONFIG path to pkg-config utility
+ PKG_CONFIG_PATH
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
+ LIBXML2_CFLAGS
+ C compiler flags for LIBXML2, overriding pkg-config
+ LIBXML2_LIBS
+ linker flags for LIBXML2, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1522,7 +1534,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-virt-top configure 1.1.0
+virt-top configure 1.1.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1820,7 +1832,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by virt-top $as_me 1.1.0, which was
+It was created by virt-top $as_me 1.1.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2684,7 +2696,7 @@ fi
# Define the identity of the package.
PACKAGE='virt-top'
- VERSION='1.1.0'
+ VERSION='1.1.1'
cat >>confdefs.h <<_ACEOF
@@ -4929,6 +4941,218 @@ rm -rf conftest*
fi
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML2" >&5
+$as_echo_n "checking for LIBXML2... " >&6; }
+
+if test -n "$LIBXML2_CFLAGS"; then
+ pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBXML2_LIBS"; then
+ pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1`
+ else
+ LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBXML2_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (libxml-2.0) were not met:
+
+$LIBXML2_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables LIBXML2_CFLAGS
+and LIBXML2_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables LIBXML2_CFLAGS
+and LIBXML2_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS
+ LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
# checking for ocamlc
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args.
@@ -6070,34 +6294,6 @@ if test "x$OCAML_PKG_unix" = "xno"; then
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package extlib" >&5
-$as_echo_n "checking for OCaml findlib package extlib... " >&6; }
-
- unset found
- unset pkg
- found=no
- for pkg in extlib ; do
- if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
-$as_echo "found" >&6; }
- OCAML_PKG_extlib=$pkg
- found=yes
- break
- fi
- done
- if test "$found" = "no" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- OCAML_PKG_extlib=no
- fi
-
-
-
-if test "x$OCAML_PKG_extlib" = "xno"; then
- as_fn_error $? "Cannot find required OCaml package 'extlib'" "$LINENO" 5
-fi
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package libvirt" >&5
$as_echo_n "checking for OCaml findlib package libvirt... " >&6; }
@@ -6178,30 +6374,6 @@ $as_echo "not found" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package csv" >&5
-$as_echo_n "checking for OCaml findlib package csv... " >&6; }
-
- unset found
- unset pkg
- found=no
- for pkg in csv ; do
- if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
-$as_echo "found" >&6; }
- OCAML_PKG_csv=$pkg
- found=yes
- break
- fi
- done
- if test "$found" = "no" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- OCAML_PKG_csv=no
- fi
-
-
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package gettext" >&5
$as_echo_n "checking for OCaml findlib package gettext... " >&6; }
@@ -6226,30 +6398,6 @@ $as_echo "not found" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package xml-light" >&5
-$as_echo_n "checking for OCaml findlib package xml-light... " >&6; }
-
- unset found
- unset pkg
- found=no
- for pkg in xml-light ; do
- if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
-$as_echo "found" >&6; }
- OCAML_PKG_xml_light=$pkg
- found=yes
- break
- fi
- done
- if test "$found" = "no" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- OCAML_PKG_xml_light=no
- fi
-
-
-
-
if test "x$OCAML_PKG_calendar" != "xno"; then
HAVE_PKG_CALENDAR_TRUE=
HAVE_PKG_CALENDAR_FALSE='#'
@@ -6258,14 +6406,6 @@ else
HAVE_PKG_CALENDAR_FALSE=
fi
- if test "x$OCAML_PKG_csv" != "xno"; then
- HAVE_PKG_CSV_TRUE=
- HAVE_PKG_CSV_FALSE='#'
-else
- HAVE_PKG_CSV_TRUE='#'
- HAVE_PKG_CSV_FALSE=
-fi
-
if test "x$OCAML_PKG_gettext" != "xno"; then
HAVE_PKG_GETTEXT_TRUE=
HAVE_PKG_GETTEXT_FALSE='#'
@@ -6274,14 +6414,6 @@ else
HAVE_PKG_GETTEXT_FALSE=
fi
- if test "x$OCAML_PKG_xml_light" != "xno"; then
- HAVE_PKG_XML_LIGHT_TRUE=
- HAVE_PKG_XML_LIGHT_FALSE='#'
-else
- HAVE_PKG_XML_LIGHT_TRUE='#'
- HAVE_PKG_XML_LIGHT_FALSE=
-fi
-
OCAML_RUNTIME_VARIANT_PIC_OPTION=""
if test "x$OCAMLC" != "xno"; then
@@ -9442,18 +9574,10 @@ if test -z "${HAVE_PKG_CALENDAR_TRUE}" && test -z "${HAVE_PKG_CALENDAR_FALSE}";
as_fn_error $? "conditional \"HAVE_PKG_CALENDAR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${HAVE_PKG_CSV_TRUE}" && test -z "${HAVE_PKG_CSV_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_PKG_CSV\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${HAVE_PKG_GETTEXT_TRUE}" && test -z "${HAVE_PKG_GETTEXT_FALSE}"; then
as_fn_error $? "conditional \"HAVE_PKG_GETTEXT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${HAVE_PKG_XML_LIGHT_TRUE}" && test -z "${HAVE_PKG_XML_LIGHT_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_PKG_XML_LIGHT\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${HAVE_PERLDOC_TRUE}" && test -z "${HAVE_PERLDOC_FALSE}"; then
as_fn_error $? "conditional \"HAVE_PERLDOC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -9863,7 +9987,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by virt-top $as_me 1.1.0, which was
+This file was extended by virt-top $as_me 1.1.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -9929,7 +10053,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-virt-top config.status 1.1.0
+virt-top config.status 1.1.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 3286941..840eba2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([virt-top],[1.1.0])
+AC_INIT([virt-top],[1.1.1])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_MACRO_DIR([m4])
@@ -36,6 +36,9 @@ AM_PROG_CC_C_O
dnl Check support for 64 bit file offsets.
AC_SYS_LARGEFILE
+dnl Check for libxml2 (required).
+PKG_CHECK_MODULES([LIBXML2], [libxml-2.0])
+
dnl Check for basic OCaml environment & findlib.
AC_PROG_OCAML
if test "$OCAMLC" = "no"; then
@@ -57,11 +60,6 @@ if test "x$OCAML_PKG_unix" = "xno"; then
AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
fi
-AC_CHECK_OCAML_PKG(extlib)
-if test "x$OCAML_PKG_extlib" = "xno"; then
- AC_MSG_ERROR([Cannot find required OCaml package 'extlib'])
-fi
-
AC_CHECK_OCAML_PKG(libvirt)
if test "x$OCAML_PKG_libvirt" = "xno"; then
AC_MSG_ERROR([Cannot find required OCaml package 'libvirt'])
@@ -74,14 +72,10 @@ fi
dnl Check for optional OCaml packages.
AC_CHECK_OCAML_PKG(calendar)
-AC_CHECK_OCAML_PKG(csv)
AC_CHECK_OCAML_PKG(gettext)
-AC_CHECK_OCAML_PKG(xml-light)
AM_CONDITIONAL([HAVE_PKG_CALENDAR], [test "x$OCAML_PKG_calendar" != "xno"])
-AM_CONDITIONAL([HAVE_PKG_CSV], [test "x$OCAML_PKG_csv" != "xno"])
AM_CONDITIONAL([HAVE_PKG_GETTEXT], [test "x$OCAML_PKG_gettext" != "xno"])
-AM_CONDITIONAL([HAVE_PKG_XML_LIGHT],[test "x$OCAML_PKG_xml_light" != "xno"])
dnl Check if ocamlc/ocamlopt -runtime-variant _pic works. It was
dnl added in OCaml >= 4.03, but in theory might be disabled by
diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in
index 49c816a..7a1f169 100755
--- a/ocaml-dep.sh.in
+++ b/ocaml-dep.sh.in
@@ -33,16 +33,6 @@ set -e
# directories must have unique names (eg. not ‘Utils’) else
# dependencies don't get built right.
include_dirs="
-common/mlgettext
-common/mlpcre
-common/mlprogress
-common/mlstdutils
-common/mltools
-common/mlutils
-common/mlv2v
-common/mlvisit
-common/mlxml
-lib
"
# Output file is always created in the current directory.
diff --git a/po/LINGUAS b/po/LINGUAS
index 296b113..5490f5b 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -29,3 +29,6 @@ tr
uk
zh_CN
zh_TW
+cs
+si
+fi
diff --git a/po/Makefile.in b/po/Makefile.in
index 6c7bdb3..ecc8dd6 100644
--- a/po/Makefile.in
+++ b/po/Makefile.in
@@ -174,6 +174,8 @@ LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
@@ -200,13 +202,10 @@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@
OCAMLVERSION = @OCAMLVERSION@
OCAML_GETTEXT = @OCAML_GETTEXT@
OCAML_PKG_calendar = @OCAML_PKG_calendar@
-OCAML_PKG_csv = @OCAML_PKG_csv@
OCAML_PKG_curses = @OCAML_PKG_curses@
-OCAML_PKG_extlib = @OCAML_PKG_extlib@
OCAML_PKG_gettext = @OCAML_PKG_gettext@
OCAML_PKG_libvirt = @OCAML_PKG_libvirt@
OCAML_PKG_unix = @OCAML_PKG_unix@
-OCAML_PKG_xml_light = @OCAML_PKG_xml_light@
OCAML_RUNTIME_VARIANT_PIC_OPTION = @OCAML_RUNTIME_VARIANT_PIC_OPTION@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -216,6 +215,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
SED = @SED@
SET_MAKE = @SET_MAKE@
diff --git a/po/POTFILES b/po/POTFILES
index 22b1625..22c6267 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -1 +1 @@
-./src/dummy.c
+./src/xml-c.c
diff --git a/po/POTFILES-ml b/po/POTFILES-ml
index b6356eb..cec31b5 100644
--- a/po/POTFILES-ml
+++ b/po/POTFILES-ml
@@ -2,9 +2,7 @@
./src/csv_output.ml
./src/main.ml
./src/opt_calendar.ml
-./src/opt_csv.ml
./src/opt_gettext.ml
-./src/opt_xml.ml
./src/redraw.ml
./src/screen.ml
./src/stream_output.ml
@@ -12,3 +10,4 @@
./src/types.ml
./src/utils.ml
./src/version.ml
+./src/xml.ml
diff --git a/po/cs.gmo b/po/cs.gmo
index 79d0fd8..8c0c358 100644
--- a/po/cs.gmo
+++ b/po/cs.gmo
Binary files differ
diff --git a/po/cs.po b/po/cs.po
index 2152b87..fea852f 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -1,20 +1,21 @@
# Zdenek <chmelarz@gmail.com>, 2016. #zanata
# Zdenek <chmelarz@gmail.com>, 2017. #zanata
-# Pavel Borecki <pavel.borecki@gmail.com>, 2018. #zanata
+# Pavel Borecki <pavel.borecki@gmail.com>, 2018. #zanata, 2021.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-27 11:32+0000\n"
-"PO-Revision-Date: 2018-11-27 06:18-0500\n"
+"PO-Revision-Date: 2021-09-04 20:04+0000\n"
"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
-"Language-Team: Czech\n"
+"Language-Team: Czech <https://translate.fedoraproject.org/projects/virt-top/"
+"master/cs/>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n"
-"X-Generator: Zanata 4.6.2\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+"X-Generator: Weblate 4.8\n"
#: ../src/top.ml:1670
msgid "# %s virt-top configuration file\n"
@@ -255,7 +256,7 @@ msgstr "Zabezpečený („kiosk“) režim"
#: ../src/top.ml:1780
msgid "Select sort field"
-msgstr "Vybrat pole řazení"
+msgstr "Vybrat kolonku, podle které řadit"
#: ../src/top.ml:191
msgid "Send debug messages to file"
@@ -323,7 +324,7 @@ msgstr "Přepnout fyzické procesory"
#: ../src/top.ml:1515
msgid "Type key or use up and down cursor keys."
-msgstr "Zadejte klávesu nebo použijte klávesy šipka nahoru a dolů"
+msgstr "Zadejte klávesu nebo použijte klávesy šipka nahoru a dolů."
#: ../src/top.ml:1809
msgid "Unknown command - try 'h' for help"
diff --git a/po/es.gmo b/po/es.gmo
index f217b7c..4a59678 100644
--- a/po/es.gmo
+++ b/po/es.gmo
Binary files differ
diff --git a/po/es.po b/po/es.po
index afe85f9..60df16a 100644
--- a/po/es.po
+++ b/po/es.po
@@ -1,10 +1,10 @@
-# Emilio Herrera <ehespinosa57@gmail.com>, 2020.
+# Emilio Herrera <ehespinosa57@gmail.com>, 2020, 2021.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-27 11:32+0000\n"
-"PO-Revision-Date: 2020-09-13 10:29+0000\n"
+"PO-Revision-Date: 2021-09-30 23:05+0000\n"
"Last-Translator: Emilio Herrera <ehespinosa57@gmail.com>\n"
"Language-Team: Spanish <https://translate.fedoraproject.org/projects/"
"virt-top/master/es/>\n"
@@ -13,7 +13,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.2.2\n"
+"X-Generator: Weblate 4.8\n"
#: ../src/top.ml:1670
msgid "# %s virt-top configuration file\n"
@@ -87,6 +87,8 @@ msgid ""
"%s:%d: configuration item ``%s'' ignored\n"
"%!"
msgstr ""
+"%s:%d: configuration item ``%s'' ignored\n"
+"%!"
#: ../src/top.ml:147
msgid "-d: cannot set a negative delay"
@@ -110,11 +112,11 @@ msgstr "CPU: %2.1f%% Mem: %Ld MB (%Ld MB por huéspedes)"
#: ../src/top.ml:1493
msgid "Change delay from %.1f to: "
-msgstr "Cambiar retraso de %.1f a:"
+msgstr "Cambiar retraso de %.1f a: "
#: ../src/top.ml:177 ../src/top.ml:175
msgid "Connect to libvirt URI"
-msgstr ""
+msgstr "Conectar a libvirt URI"
#: ../src/top.ml:1744
msgid "Connect: %s; Hostname: %s"
@@ -146,7 +148,7 @@ msgstr "Deshabilita stadísticas del dispositivo de bloque en CVS"
#: ../src/top.ml:183
msgid "Disable memory stats in CSV"
-msgstr ""
+msgstr "Deshabilita estadísticas de memoria en CVS"
#: ../src/top.ml:187
msgid "Disable net stats in CSV"
@@ -206,6 +208,7 @@ msgstr ""
msgid ""
"NB: If you want to monitor a local hypervisor, you usually need to be root"
msgstr ""
+"NB: Si desea monitorizar un hipervisor local, normalmente necesita ser root"
#: ../src/top.ml:70
msgid "Net RX bytes"
@@ -245,7 +248,7 @@ msgstr "CLASIFICANDO"
#: ../src/top.ml:206
msgid "Secure (\"kiosk\") mode"
-msgstr ""
+msgstr "Modo seguro (\"kiosk\")"
#: ../src/top.ml:1780
msgid "Select sort field"
@@ -338,19 +341,19 @@ msgstr "predeterminado"
#: ../src/top.ml:210
msgid "dump output to stdout (no userinterface)"
-msgstr ""
+msgstr "volcar la salida hacia la salida estándar (no a la interfaz de usuario)"
#: ../src/opt_xml.ml:46
msgid "get_xml_desc didn't return <domain/>"
-msgstr "el get_xml_desc no ha retornado <domain/n>"
+msgstr "get_xml_desc no ha devuelto <domain/n>"
#: ../src/top.ml:212
msgid "show block device load in bytes rather than reqs"
-msgstr ""
+msgstr "muestre la carga del dispositivo del bloque en bytes en lugar de reqs"
#: ../src/top.ml:1767
msgid "toggle block info req/bytes"
-msgstr ""
+msgstr "Alternar información de bloque requerida / bytes"
#: ../src/top.ml:1725
msgid "virt-top %s ocaml-libvirt %s libvirt %d.%d.%d by Red Hat"
diff --git a/po/fi.gmo b/po/fi.gmo
new file mode 100644
index 0000000..331191c
--- /dev/null
+++ b/po/fi.gmo
Binary files differ
diff --git a/po/fi.po b/po/fi.po
new file mode 100644
index 0000000..d477089
--- /dev/null
+++ b/po/fi.po
@@ -0,0 +1,376 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Jan Kuparinen <copper_fin@hotmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-03-27 11:32+0000\n"
+"PO-Revision-Date: 2021-04-15 18:02+0000\n"
+"Last-Translator: Jan Kuparinen <copper_fin@hotmail.com>\n"
+"Language-Team: Finnish <https://translate.fedoraproject.org/projects/"
+"virt-top/master/fi/>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.5.3\n"
+
+#: ../src/top.ml:1670
+msgid "# %s virt-top configuration file\n"
+msgstr "# %s virt-top määritystiedosto\n"
+
+#: ../src/top.ml:1688
+msgid "# Enable CSV output to the named file\n"
+msgstr "# Ota käyttöön CSV-ulostulo nimettyyn tiedostoon\n"
+
+#: ../src/top.ml:1691
+msgid "# To protect this file from being overwritten, uncomment next line\n"
+msgstr ""
+"# Suojaa tämä tiedosto ylikirjoitukselta poistamalla seuraavan rivin "
+"kommenttimerkki\n"
+
+#: ../src/top.ml:1685
+msgid "# To send debug and error messages to a file, uncomment next line\n"
+msgstr ""
+"# Jos haluat lähettää virheenkorjaus- ja virhesanomia tiedostoon poista "
+"seuraavan rivin kommenttimerkki\n"
+
+#: ../src/top.ml:1671
+msgid "# generated on %s by %s\n"
+msgstr "# luotu kohteessa %s %s:llä\n"
+
+#: ../src/top.ml:65
+msgid "%CPU"
+msgstr "%CPU"
+
+#: ../src/top.ml:66
+msgid "%MEM"
+msgstr "%MEM"
+
+#: ../src/top.ml:1237
+msgid "%d domains, %d active, %d running, %d sleeping, %d paused, %d inactive D:%d O:%d X:%d"
+msgstr ""
+"%d toimialuetta, %d aktiivista, %d käynnissä, %d unessa, %d keskeytetty, %d "
+"epäaktiivinen D:%d O:%d X:%d"
+
+#: ../src/top.ml:245
+msgid "%s: could not parse '%s' in init file: expecting %s"
+msgstr "%s: kohdetta '%s' ei voitu jäsentää init-tiedostossa: odotettiin %s"
+
+#: ../src/top.ml:240
+msgid "%s: could not parse '%s' in init file: expecting a number"
+msgstr ""
+"%s: kohdetta '%s' ei voitu jäsentää init-tiedostossa: odotettiin numeroa"
+
+#: ../src/top.ml:235
+msgid "%s: could not parse '%s' in init file: expecting an integer"
+msgstr ""
+"%s: kohdetta '%s' ei voitu jäsentää init-tiedostossa: odotettiin "
+"kokonaislukua"
+
+#: ../src/top.ml:105
+msgid "%s: display should be %s"
+msgstr "%s: näytön tulee olla %s"
+
+#: ../src/top.ml:83
+msgid "%s: sort order should be: %s"
+msgstr "%s: lajittelujärjestyksen tulisi olla: %s"
+
+#: ../src/top.ml:217
+msgid "%s: unknown parameter"
+msgstr "%s: tuntematon parametri"
+
+#: ../src/top.ml:269
+msgid "%s:%d: configuration item ``%s'' ignored\n%!"
+msgstr ""
+"%s:%d: määrityskohde ``%s'' ohitettiin\n"
+"%!"
+
+#: ../src/top.ml:147
+msgid "-d: cannot set a negative delay"
+msgstr "-d: ei voida asettaa negatiivista viivettä"
+
+#: ../src/top.ml:173
+msgid "Batch mode"
+msgstr "Erätila"
+
+#: ../src/top.ml:72
+msgid "Block read reqs"
+msgstr "Estä lukupyynnöt"
+
+#: ../src/top.ml:73
+msgid "Block write reqs"
+msgstr "Estä kirjoituspyynnöt"
+
+#: ../src/top.ml:1244
+msgid "CPU: %2.1f%% Mem: %Ld MB (%Ld MB by guests)"
+msgstr "CPU: %2.1f%% Mem: %Ld MB (%Ld MB vierailla)"
+
+#: ../src/top.ml:1493
+msgid "Change delay from %.1f to: "
+msgstr "Vaihda viive %.1f: stä seuraavaan: "
+
+#: ../src/top.ml:177 ../src/top.ml:175
+msgid "Connect to libvirt URI"
+msgstr "Yhdistä libvirt URI:hen"
+
+#: ../src/top.ml:1744
+msgid "Connect: %s; Hostname: %s"
+msgstr "Yhdistä: %s; Isäntänimi: %s"
+
+#: ../src/top.ml:1783
+msgid "DISPLAY MODES"
+msgstr "NÄYTTÖTILAT"
+
+#: ../src/top.ml:1500
+msgid "Delay must be > 0"
+msgstr "Viiveen on oltava > 0"
+
+#: ../src/top.ml:189
+msgid "Delay time interval (seconds)"
+msgstr "Viiveen aikaväli (sekuntia)"
+
+#: ../src/top.ml:1737
+msgid "Delay: %.1f secs; Batch: %s; Secure: %s; Sort: %s"
+msgstr "Viive: %.1f sekuntia; Erä: %s; Suojattu: %s; Lajittelu: %s"
+
+#: ../src/top.ml:181
+msgid "Disable CPU stats in CSV"
+msgstr "Poista CPU-tilastot käytöstä CSV:ssä"
+
+#: ../src/top.ml:185
+msgid "Disable block device stats in CSV"
+msgstr "Poista lohkolaitetilastot käytöstä CSV:ssä"
+
+#: ../src/top.ml:183
+msgid "Disable memory stats in CSV"
+msgstr "Poista muistitilastot käytöstä CSV:ssä"
+
+#: ../src/top.ml:187
+msgid "Disable net stats in CSV"
+msgstr "Poista verkkotilastot käytöstä CSV:ssä"
+
+#: ../src/top.ml:214
+msgid "Display version number and exit"
+msgstr "Näytä versionumero ja lopeta"
+
+#: ../src/top.ml:199
+msgid "Do not read init file"
+msgstr "Älä lue init-tiedostoa"
+
+#: ../src/top.ml:68
+msgid "Domain ID"
+msgstr "Toimialueen ID"
+
+#: ../src/top.ml:69
+msgid "Domain name"
+msgstr "Toimialueen nimi"
+
+#: ../src/top.ml:1797
+msgid "Domains display"
+msgstr "Toimialueiden esitys"
+
+#: ../src/main.ml:69 ../src/main.ml:44 ../src/top.ml:1711 ../src/top.ml:1708
+msgid "Error"
+msgstr "Virhe"
+
+#: ../src/top.ml:193
+msgid "Exit at given time"
+msgstr "Poistu tiettynä ajankohtana"
+
+#: ../src/top.ml:1766
+msgid "Help"
+msgstr "Ohjeet"
+
+#: ../src/top.ml:195
+msgid "Historical CPU delay"
+msgstr "Historiallinen suorittimen viive"
+
+#: ../src/top.ml:179
+msgid "Log statistics to CSV file"
+msgstr "Kirjaa tilastot CSV-tiedostoon"
+
+#: ../src/top.ml:1749
+msgid "MAIN KEYS"
+msgstr "PÄÄNÄPPÄIMET"
+
+#: ../src/top.ml:1804
+msgid "More help in virt-top(1) man page. Press any key to return."
+msgstr ""
+"Lisää ohjeita man virt-top(1) sivulla. Palaa painamalla mitä tahansa "
+"näppäintä."
+
+#: ../src/top.ml:294
+msgid "NB: If you want to monitor a local hypervisor, you usually need to be root"
+msgstr ""
+"HUOM: Jos haluat tarkkailla paikallista hypervisoria, sinun on yleensä "
+"oltava root-käyttäjä"
+
+#: ../src/top.ml:70
+msgid "Net RX bytes"
+msgstr "Netto RX-tavut"
+
+#: ../src/top.ml:71
+msgid "Net TX bytes"
+msgstr "Netto TX-tavut"
+
+#: ../src/top.ml:1506
+msgid "Not a valid number"
+msgstr "Virheellinen numero"
+
+#: ../src/top.ml:201
+msgid "Number of iterations to run"
+msgstr "Suoritettavien iteraatioiden määrä"
+
+#: ../src/top.ml:1740 ../src/top.ml:1739
+msgid "Off"
+msgstr "Poissa"
+
+#: ../src/top.ml:1740 ../src/top.ml:1739
+msgid "On"
+msgstr "Päällä"
+
+#: ../src/top.ml:1764
+msgid "Quit"
+msgstr "Lopeta"
+
+#: ../src/top.ml:208
+msgid "Run from a script (no user interface)"
+msgstr "Suorita komentosarjalta (ei käyttöliittymää)"
+
+#: ../src/top.ml:1771
+msgid "SORTING"
+msgstr "LAJITTELU"
+
+#: ../src/top.ml:206
+msgid "Secure (\"kiosk\") mode"
+msgstr "Suojattu (\"kioski\") -tila"
+
+#: ../src/top.ml:1780
+msgid "Select sort field"
+msgstr "Valitse lajittelukenttä"
+
+#: ../src/top.ml:191
+msgid "Send debug messages to file"
+msgstr "Lähetä vianselvitysviestit tiedostoon"
+
+#: ../src/top.ml:197
+msgid "Set name of init file"
+msgstr "Anna init-tiedoston nimi"
+
+#: ../src/top.ml:203
+msgid "Set sort order (%s)"
+msgstr "Aseta lajittelujärjestys (%s)"
+
+#: ../src/top.ml:1514
+msgid "Set sort order for main display"
+msgstr "Aseta lajittelujärjestys päänäytölle"
+
+#: ../src/top.ml:1765
+msgid "Set update interval"
+msgstr "Aseta päivitysväli"
+
+#: ../src/top.ml:1776
+msgid "Sort by %CPU"
+msgstr "Lajittele %CPU:n mukaan"
+
+#: ../src/top.ml:1777
+msgid "Sort by %MEM"
+msgstr "Lajittele %MUISTIN:n mukaan"
+
+#: ../src/top.ml:1779
+msgid "Sort by ID"
+msgstr "Lajittele %ID:n mukaan"
+
+#: ../src/top.ml:1778
+msgid "Sort by TIME"
+msgstr "Lajittele AJAN mukaan"
+
+#: ../src/top.ml:171
+msgid "Start by displaying block devices"
+msgstr "Aloita näyttämällä lohkolaitteet"
+
+#: ../src/top.ml:169
+msgid "Start by displaying network interfaces"
+msgstr "Aloita näyttämällä verkkoliitännät"
+
+#: ../src/top.ml:167
+msgid "Start by displaying pCPUs (default: tasks)"
+msgstr "Aloita näyttämällä pCPU:t (oletus: tehtävät)"
+
+#: ../src/top.ml:67
+msgid "TIME (CPU time)"
+msgstr "TIME (suorittimen aika)"
+
+#: ../src/top.ml:1800
+msgid "Toggle block devices"
+msgstr "Vaihda lohkolaitteet"
+
+#: ../src/top.ml:1799
+msgid "Toggle network interfaces"
+msgstr "Vaihda verkkoliitännät"
+
+#: ../src/top.ml:1798
+msgid "Toggle physical CPUs"
+msgstr "Vaihda fyysiset suorittimet"
+
+#: ../src/top.ml:1515
+msgid "Type key or use up and down cursor keys."
+msgstr "Paina näppäintä tai käytä ylös- ja alas-nuolinäppäimiä."
+
+#: ../src/top.ml:1809
+msgid "Unknown command - try 'h' for help"
+msgstr "Tuntematon komento - kokeile 'h' ohjeet"
+
+#: ../src/top.ml:1763
+msgid "Update display"
+msgstr "Päivitä näyttö"
+
+#: ../src/top.ml:1703
+msgid "Wrote settings to %s"
+msgstr "Kirjoitti asetukset kohteeseen %s"
+
+#: ../src/top.ml:1745
+msgid "default"
+msgstr "Oletus"
+
+#: ../src/top.ml:210
+msgid "dump output to stdout (no userinterface)"
+msgstr "tulosta ulostulo vakiotulosteeseen (ilman käyttöliittymää)"
+
+#: ../src/opt_xml.ml:46
+msgid "get_xml_desc didn't return <domain/>"
+msgstr "get_xml_desc ei palauttanut <domain/>"
+
+#: ../src/top.ml:212
+msgid "show block device load in bytes rather than reqs"
+msgstr "näytä lohkolaitteen kuormitus tavuina mieluummin kuin kyselyinä"
+
+#: ../src/top.ml:1767
+msgid "toggle block info req/bytes"
+msgstr "vaihda lohkotiedot kyselyt/tavut"
+
+#: ../src/top.ml:1725
+msgid "virt-top %s ocaml-libvirt %s libvirt %d.%d.%d by Red Hat"
+msgstr "virt-top %s ocaml-libvirt %s libvirt %d.%d.%d, kirjoittanut Red Hat"
+
+#: ../src/top.ml:218
+msgid "virt-top : a 'top'-like utility for virtualization\n\nSUMMARY\n virt-top [-options]\n\nOPTIONS"
+msgstr ""
+"virt-top: 'top'-tyyppinen apuohjelma virtualisointiin\n"
+"\n"
+"YHTEENVETO\n"
+" virt-top [-optiot]\n"
+"\n"
+"VAIHTOEHDOT"
+
+#: ../src/top.ml:42
+msgid "virt-top was compiled without support for CSV files"
+msgstr "virt-top käännettiin ilman tukea CSV-tiedostoille"
+
+#: ../src/top.ml:53
+msgid "virt-top was compiled without support for dates and times"
+msgstr "virt-top käännettiin ilman tukea päivämäärille ja ajoille"
diff --git a/po/id.gmo b/po/id.gmo
index 408b67b..b5a9304 100644
--- a/po/id.gmo
+++ b/po/id.gmo
Binary files differ
diff --git a/po/id.po b/po/id.po
index b2eb577..d7d3752 100644
--- a/po/id.po
+++ b/po/id.po
@@ -3,23 +3,24 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
-# Andika Triwidada <andika@gmail.com>, 2014
-# Andika Triwidada <andika@gmail.com>, 2017. #zanata
+# Andika Triwidada <andika@gmail.com>, 2014, 2021.
+# Andika Triwidada <andika@gmail.com>, 2017. #zanata, 2021.
+# Didik Supriadi <didiksupriadi41@gmail.com>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-27 11:32+0000\n"
-"PO-Revision-Date: 2014-09-07 03:27-0400\n"
-"Last-Translator: Andika Triwidada <andika@gmail.com>\n"
-"Language-Team: Indonesian (http://www.transifex.com/projects/p/virttop/"
-"language/id/)\n"
+"PO-Revision-Date: 2021-08-22 11:04+0000\n"
+"Last-Translator: Didik Supriadi <didiksupriadi41@gmail.com>\n"
+"Language-Team: Indonesian <https://translate.fedoraproject.org/projects/"
+"virt-top/master/id/>\n"
"Language: id\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Zanata 4.6.2\n"
+"X-Generator: Weblate 4.8\n"
#: ../src/top.ml:1670
msgid "# %s virt-top configuration file\n"
@@ -118,7 +119,7 @@ msgstr "CPU: %2.1f%% Mem: %Ld MB (%Ld MB oleh guest)"
#: ../src/top.ml:1493
msgid "Change delay from %.1f to: "
-msgstr "Ubah tundaan dari %.1f ke:"
+msgstr "Ubah delay dari %.1f ke: "
#: ../src/top.ml:177 ../src/top.ml:175
msgid "Connect to libvirt URI"
@@ -343,7 +344,7 @@ msgstr "Menulis pengaturan ke %s"
#: ../src/top.ml:1745
msgid "default"
-msgstr "baku"
+msgstr "default"
#: ../src/top.ml:210
msgid "dump output to stdout (no userinterface)"
@@ -387,4 +388,4 @@ msgstr "virt-top dikompail tanpa dukungan berkas CSV"
#: ../src/top.ml:53
msgid "virt-top was compiled without support for dates and times"
-msgstr ""
+msgstr "virt-top dikompail tanpa dukungan tanggal dan waktu"
diff --git a/po/nl.gmo b/po/nl.gmo
index ea6efa5..9797757 100644
--- a/po/nl.gmo
+++ b/po/nl.gmo
Binary files differ
diff --git a/po/nl.po b/po/nl.po
index b5ffc71..6d6a7d1 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -1,41 +1,46 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+# Geert Warrink <geert.warrink@onsnet.nu>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-27 11:32+0000\n"
-"PO-Revision-Date: 2011-03-29 02:08-0400\n"
-"Last-Translator: warrink <geert.warrink@onsnet.nu>\n"
-"Language-Team: Dutch <>\n"
+"PO-Revision-Date: 2021-02-28 15:40+0000\n"
+"Last-Translator: Geert Warrink <geert.warrink@onsnet.nu>\n"
+"Language-Team: Dutch <https://translate.fedoraproject.org/projects/virt-top/"
+"master/nl/>\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1)\n"
-"X-Generator: Zanata 4.6.2\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.4.2\n"
#: ../src/top.ml:1670
msgid "# %s virt-top configuration file\n"
-msgstr ""
+msgstr "# %s virt-top configuratiebestand\n"
#: ../src/top.ml:1688
msgid "# Enable CSV output to the named file\n"
-msgstr ""
+msgstr "# Schakel CSV-uitvoer naar het genoemde bestand in\n"
#: ../src/top.ml:1691
msgid "# To protect this file from being overwritten, uncomment next line\n"
msgstr ""
+"# Om te voorkomen dat dit bestand wordt overschreven, verwijder je het "
+"commentaar op de volgende regel\n"
#: ../src/top.ml:1685
msgid "# To send debug and error messages to a file, uncomment next line\n"
msgstr ""
+"# Als je foutopsporings- en foutmeldingen naar een bestand wilt sturen, "
+"verwijder je het commentaar op de volgende regel\n"
#: ../src/top.ml:1671
msgid "# generated on %s by %s\n"
-msgstr ""
+msgstr "# gegenereerd op %s door %s\n"
#: ../src/top.ml:65
msgid "%CPU"
@@ -55,15 +60,15 @@ msgstr ""
#: ../src/top.ml:245
msgid "%s: could not parse '%s' in init file: expecting %s"
-msgstr ""
+msgstr "%s: kon '%s' in init-bestand niet ontleden: verwachtte %s"
#: ../src/top.ml:240
msgid "%s: could not parse '%s' in init file: expecting a number"
-msgstr ""
+msgstr "%s: kon '%s' in init-bestand niet ontleden: verwachtte een getal"
#: ../src/top.ml:235
msgid "%s: could not parse '%s' in init file: expecting an integer"
-msgstr ""
+msgstr "%s: kon '%s' in init-bestand niet ontleden: verwachtte een geheel getal"
#: ../src/top.ml:105
msgid "%s: display should be %s"
@@ -82,6 +87,8 @@ msgid ""
"%s:%d: configuration item ``%s'' ignored\n"
"%!"
msgstr ""
+"%s:%d: configuratie-item ``%s'' genegeerd\n"
+"%!"
#: ../src/top.ml:147
msgid "-d: cannot set a negative delay"
@@ -89,7 +96,7 @@ msgstr "-d: kan geen negatieve vertraging instellen"
#: ../src/top.ml:173
msgid "Batch mode"
-msgstr "Batch mode"
+msgstr "Batch modus"
#: ../src/top.ml:72
msgid "Block read reqs"
@@ -109,7 +116,7 @@ msgstr "Verander vertraging van %.1f naar: "
#: ../src/top.ml:177 ../src/top.ml:175
msgid "Connect to libvirt URI"
-msgstr ""
+msgstr "Verbinden met libvirt URI"
#: ../src/top.ml:1744
msgid "Connect: %s; Hostname: %s"
@@ -141,7 +148,7 @@ msgstr "Zet blokapparaat stats in CSV uit"
#: ../src/top.ml:183
msgid "Disable memory stats in CSV"
-msgstr ""
+msgstr "Zet netwerk stats in CSV uit"
#: ../src/top.ml:187
msgid "Disable net stats in CSV"
@@ -200,6 +207,7 @@ msgstr ""
msgid ""
"NB: If you want to monitor a local hypervisor, you usually need to be root"
msgstr ""
+"NB: Als je een lokale hypervisor wilt monitoren, moet je meestal root zijn"
#: ../src/top.ml:70
msgid "Net RX bytes"
@@ -239,7 +247,7 @@ msgstr "SORTEREN"
#: ../src/top.ml:206
msgid "Secure (\"kiosk\") mode"
-msgstr ""
+msgstr "Veilige (\"kiosk\") modus"
#: ../src/top.ml:1780
msgid "Select sort field"
@@ -331,7 +339,7 @@ msgstr "standaard"
#: ../src/top.ml:210
msgid "dump output to stdout (no userinterface)"
-msgstr ""
+msgstr "dump output naar stdout (geen gebruikersinterface)"
#: ../src/opt_xml.ml:46
msgid "get_xml_desc didn't return <domain/>"
@@ -339,11 +347,11 @@ msgstr "get_xml_desc gaf <domain/> niet terug"
#: ../src/top.ml:212
msgid "show block device load in bytes rather than reqs"
-msgstr ""
+msgstr "toon blokapparaatbelasting in bytes in plaats van reqs"
#: ../src/top.ml:1767
msgid "toggle block info req/bytes"
-msgstr ""
+msgstr "schakel block info req/bytes om"
#: ../src/top.ml:1725
msgid "virt-top %s ocaml-libvirt %s libvirt %d.%d.%d by Red Hat"
diff --git a/po/si.gmo b/po/si.gmo
new file mode 100644
index 0000000..12c865e
--- /dev/null
+++ b/po/si.gmo
Binary files differ
diff --git a/po/si.po b/po/si.po
new file mode 100644
index 0000000..0336af1
--- /dev/null
+++ b/po/si.po
@@ -0,0 +1,355 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Hela Basa <r45xveza@pm.me>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-03-27 11:32+0000\n"
+"PO-Revision-Date: 2021-08-19 07:04+0000\n"
+"Last-Translator: Hela Basa <r45xveza@pm.me>\n"
+"Language-Team: Sinhala <https://translate.fedoraproject.org/projects/"
+"virt-top/master/si/>\n"
+"Language: si\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.7.2\n"
+
+#: ../src/top.ml:1670
+msgid "# %s virt-top configuration file\n"
+msgstr ""
+
+#: ../src/top.ml:1688
+msgid "# Enable CSV output to the named file\n"
+msgstr ""
+
+#: ../src/top.ml:1691
+msgid "# To protect this file from being overwritten, uncomment next line\n"
+msgstr ""
+
+#: ../src/top.ml:1685
+msgid "# To send debug and error messages to a file, uncomment next line\n"
+msgstr ""
+
+#: ../src/top.ml:1671
+msgid "# generated on %s by %s\n"
+msgstr ""
+
+#: ../src/top.ml:65
+msgid "%CPU"
+msgstr ""
+
+#: ../src/top.ml:66
+msgid "%MEM"
+msgstr ""
+
+#: ../src/top.ml:1237
+msgid "%d domains, %d active, %d running, %d sleeping, %d paused, %d inactive D:%d O:%d X:%d"
+msgstr ""
+
+#: ../src/top.ml:245
+msgid "%s: could not parse '%s' in init file: expecting %s"
+msgstr ""
+
+#: ../src/top.ml:240
+msgid "%s: could not parse '%s' in init file: expecting a number"
+msgstr ""
+
+#: ../src/top.ml:235
+msgid "%s: could not parse '%s' in init file: expecting an integer"
+msgstr ""
+
+#: ../src/top.ml:105
+msgid "%s: display should be %s"
+msgstr ""
+
+#: ../src/top.ml:83
+msgid "%s: sort order should be: %s"
+msgstr ""
+
+#: ../src/top.ml:217
+msgid "%s: unknown parameter"
+msgstr ""
+
+#: ../src/top.ml:269
+msgid "%s:%d: configuration item ``%s'' ignored\n%!"
+msgstr ""
+
+#: ../src/top.ml:147
+msgid "-d: cannot set a negative delay"
+msgstr ""
+
+#: ../src/top.ml:173
+msgid "Batch mode"
+msgstr ""
+
+#: ../src/top.ml:72
+msgid "Block read reqs"
+msgstr ""
+
+#: ../src/top.ml:73
+msgid "Block write reqs"
+msgstr ""
+
+#: ../src/top.ml:1244
+msgid "CPU: %2.1f%% Mem: %Ld MB (%Ld MB by guests)"
+msgstr ""
+
+#: ../src/top.ml:1493
+msgid "Change delay from %.1f to: "
+msgstr ""
+
+#: ../src/top.ml:177 ../src/top.ml:175
+msgid "Connect to libvirt URI"
+msgstr ""
+
+#: ../src/top.ml:1744
+msgid "Connect: %s; Hostname: %s"
+msgstr ""
+
+#: ../src/top.ml:1783
+msgid "DISPLAY MODES"
+msgstr ""
+
+#: ../src/top.ml:1500
+msgid "Delay must be > 0"
+msgstr ""
+
+#: ../src/top.ml:189
+msgid "Delay time interval (seconds)"
+msgstr ""
+
+#: ../src/top.ml:1737
+msgid "Delay: %.1f secs; Batch: %s; Secure: %s; Sort: %s"
+msgstr ""
+
+#: ../src/top.ml:181
+msgid "Disable CPU stats in CSV"
+msgstr ""
+
+#: ../src/top.ml:185
+msgid "Disable block device stats in CSV"
+msgstr ""
+
+#: ../src/top.ml:183
+msgid "Disable memory stats in CSV"
+msgstr ""
+
+#: ../src/top.ml:187
+msgid "Disable net stats in CSV"
+msgstr ""
+
+#: ../src/top.ml:214
+msgid "Display version number and exit"
+msgstr ""
+
+#: ../src/top.ml:199
+msgid "Do not read init file"
+msgstr ""
+
+#: ../src/top.ml:68
+msgid "Domain ID"
+msgstr ""
+
+#: ../src/top.ml:69
+msgid "Domain name"
+msgstr ""
+
+#: ../src/top.ml:1797
+msgid "Domains display"
+msgstr ""
+
+#: ../src/main.ml:69 ../src/main.ml:44 ../src/top.ml:1711 ../src/top.ml:1708
+msgid "Error"
+msgstr ""
+
+#: ../src/top.ml:193
+msgid "Exit at given time"
+msgstr ""
+
+#: ../src/top.ml:1766
+msgid "Help"
+msgstr ""
+
+#: ../src/top.ml:195
+msgid "Historical CPU delay"
+msgstr ""
+
+#: ../src/top.ml:179
+msgid "Log statistics to CSV file"
+msgstr ""
+
+#: ../src/top.ml:1749
+msgid "MAIN KEYS"
+msgstr ""
+
+#: ../src/top.ml:1804
+msgid "More help in virt-top(1) man page. Press any key to return."
+msgstr ""
+
+#: ../src/top.ml:294
+msgid "NB: If you want to monitor a local hypervisor, you usually need to be root"
+msgstr ""
+
+#: ../src/top.ml:70
+msgid "Net RX bytes"
+msgstr ""
+
+#: ../src/top.ml:71
+msgid "Net TX bytes"
+msgstr ""
+
+#: ../src/top.ml:1506
+msgid "Not a valid number"
+msgstr ""
+
+#: ../src/top.ml:201
+msgid "Number of iterations to run"
+msgstr ""
+
+#: ../src/top.ml:1740 ../src/top.ml:1739
+msgid "Off"
+msgstr ""
+
+#: ../src/top.ml:1740 ../src/top.ml:1739
+msgid "On"
+msgstr ""
+
+#: ../src/top.ml:1764
+msgid "Quit"
+msgstr ""
+
+#: ../src/top.ml:208
+msgid "Run from a script (no user interface)"
+msgstr ""
+
+#: ../src/top.ml:1771
+msgid "SORTING"
+msgstr ""
+
+#: ../src/top.ml:206
+msgid "Secure (\"kiosk\") mode"
+msgstr ""
+
+#: ../src/top.ml:1780
+msgid "Select sort field"
+msgstr ""
+
+#: ../src/top.ml:191
+msgid "Send debug messages to file"
+msgstr ""
+
+#: ../src/top.ml:197
+msgid "Set name of init file"
+msgstr ""
+
+#: ../src/top.ml:203
+msgid "Set sort order (%s)"
+msgstr ""
+
+#: ../src/top.ml:1514
+msgid "Set sort order for main display"
+msgstr ""
+
+#: ../src/top.ml:1765
+msgid "Set update interval"
+msgstr ""
+
+#: ../src/top.ml:1776
+msgid "Sort by %CPU"
+msgstr ""
+
+#: ../src/top.ml:1777
+msgid "Sort by %MEM"
+msgstr ""
+
+#: ../src/top.ml:1779
+msgid "Sort by ID"
+msgstr ""
+
+#: ../src/top.ml:1778
+msgid "Sort by TIME"
+msgstr ""
+
+#: ../src/top.ml:171
+msgid "Start by displaying block devices"
+msgstr ""
+
+#: ../src/top.ml:169
+msgid "Start by displaying network interfaces"
+msgstr ""
+
+#: ../src/top.ml:167
+msgid "Start by displaying pCPUs (default: tasks)"
+msgstr ""
+
+#: ../src/top.ml:67
+msgid "TIME (CPU time)"
+msgstr ""
+
+#: ../src/top.ml:1800
+msgid "Toggle block devices"
+msgstr ""
+
+#: ../src/top.ml:1799
+msgid "Toggle network interfaces"
+msgstr ""
+
+#: ../src/top.ml:1798
+msgid "Toggle physical CPUs"
+msgstr ""
+
+#: ../src/top.ml:1515
+msgid "Type key or use up and down cursor keys."
+msgstr ""
+
+#: ../src/top.ml:1809
+msgid "Unknown command - try 'h' for help"
+msgstr ""
+
+#: ../src/top.ml:1763
+msgid "Update display"
+msgstr ""
+
+#: ../src/top.ml:1703
+msgid "Wrote settings to %s"
+msgstr ""
+
+#: ../src/top.ml:1745
+msgid "default"
+msgstr "පෙරනිමි"
+
+#: ../src/top.ml:210
+msgid "dump output to stdout (no userinterface)"
+msgstr ""
+
+#: ../src/opt_xml.ml:46
+msgid "get_xml_desc didn't return <domain/>"
+msgstr ""
+
+#: ../src/top.ml:212
+msgid "show block device load in bytes rather than reqs"
+msgstr ""
+
+#: ../src/top.ml:1767
+msgid "toggle block info req/bytes"
+msgstr ""
+
+#: ../src/top.ml:1725
+msgid "virt-top %s ocaml-libvirt %s libvirt %d.%d.%d by Red Hat"
+msgstr ""
+
+#: ../src/top.ml:218
+msgid "virt-top : a 'top'-like utility for virtualization\n\nSUMMARY\n virt-top [-options]\n\nOPTIONS"
+msgstr ""
+
+#: ../src/top.ml:42
+msgid "virt-top was compiled without support for CSV files"
+msgstr ""
+
+#: ../src/top.ml:53
+msgid "virt-top was compiled without support for dates and times"
+msgstr ""
diff --git a/po/virt-top.pot b/po/virt-top.pot
index 7cb6bc5..0b3a28e 100644
--- a/po/virt-top.pot
+++ b/po/virt-top.pot
@@ -6,10 +6,10 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: virt-top 1.1.0\n"
+"Project-Id-Version: virt-top 1.1.1\n"
"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
"component=libguestfs&product=Virtualization+Tools\n"
-"POT-Creation-Date: 2021-10-01 16:24+0100\n"
+"POT-Creation-Date: 2021-11-03 20:20+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,23 +18,23 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/top.ml:588
+#: src/top.ml:581
msgid "# %s virt-top configuration file\n"
msgstr ""
-#: src/top.ml:606
+#: src/top.ml:599
msgid "# Enable CSV output to the named file\n"
msgstr ""
-#: src/top.ml:609
+#: src/top.ml:602
msgid "# To protect this file from being overwritten, uncomment next line\n"
msgstr ""
-#: src/top.ml:603
+#: src/top.ml:596
msgid "# To send debug and error messages to a file, uncomment next line\n"
msgstr ""
-#: src/top.ml:589
+#: src/top.ml:582
msgid "# generated on %s by %s\n"
msgstr ""
@@ -46,21 +46,21 @@ msgstr ""
msgid "%MEM"
msgstr ""
-#: src/redraw.ml:481
+#: src/redraw.ml:480
msgid ""
"%d domains, %d active, %d running, %d sleeping, %d paused, %d inactive D:%d "
"O:%d X:%d"
msgstr ""
-#: src/top.ml:177
+#: src/top.ml:170
msgid "%s: could not parse '%s' in init file: expecting %s"
msgstr ""
-#: src/top.ml:172
+#: src/top.ml:165
msgid "%s: could not parse '%s' in init file: expecting a number"
msgstr ""
-#: src/top.ml:167
+#: src/top.ml:160
msgid "%s: could not parse '%s' in init file: expecting an integer"
msgstr ""
@@ -72,21 +72,21 @@ msgstr ""
msgid "%s: sort order should be: %s"
msgstr ""
-#: src/top.ml:149
+#: src/top.ml:142
msgid "%s: unknown parameter"
msgstr ""
-#: src/top.ml:201
+#: src/top.ml:194
msgid ""
"%s:%d: configuration item ``%s'' ignored\n"
"%!"
msgstr ""
-#: src/top.ml:79
+#: src/top.ml:72
msgid "-d: cannot set a negative delay"
msgstr ""
-#: src/top.ml:105
+#: src/top.ml:98
msgid "Batch mode"
msgstr ""
@@ -98,59 +98,59 @@ msgstr ""
msgid "Block write reqs"
msgstr ""
-#: src/redraw.ml:488
+#: src/redraw.ml:487
msgid "CPU: %2.1f%% Mem: %Ld MB (%Ld MB by guests)"
msgstr ""
-#: src/top.ml:411
+#: src/top.ml:404
msgid "Change delay from %.1f to: "
msgstr ""
-#: src/top.ml:109 src/top.ml:107
+#: src/top.ml:102 src/top.ml:100
msgid "Connect to libvirt URI"
msgstr ""
-#: src/top.ml:662
+#: src/top.ml:655
msgid "Connect: %s; Hostname: %s"
msgstr ""
-#: src/top.ml:701
+#: src/top.ml:694
msgid "DISPLAY MODES"
msgstr ""
-#: src/top.ml:418
+#: src/top.ml:411
msgid "Delay must be > 0"
msgstr ""
-#: src/top.ml:121
+#: src/top.ml:114
msgid "Delay time interval (seconds)"
msgstr ""
-#: src/top.ml:655
+#: src/top.ml:648
msgid "Delay: %.1f secs; Batch: %s; Secure: %s; Sort: %s"
msgstr ""
-#: src/top.ml:113
+#: src/top.ml:106
msgid "Disable CPU stats in CSV"
msgstr ""
-#: src/top.ml:117
+#: src/top.ml:110
msgid "Disable block device stats in CSV"
msgstr ""
-#: src/top.ml:115
+#: src/top.ml:108
msgid "Disable memory stats in CSV"
msgstr ""
-#: src/top.ml:119
+#: src/top.ml:112
msgid "Disable net stats in CSV"
msgstr ""
-#: src/top.ml:146
+#: src/top.ml:139
msgid "Display version number and exit"
msgstr ""
-#: src/top.ml:131
+#: src/top.ml:124
msgid "Do not read init file"
msgstr ""
@@ -162,39 +162,39 @@ msgstr ""
msgid "Domain name"
msgstr ""
-#: src/top.ml:715
+#: src/top.ml:708
msgid "Domains display"
msgstr ""
-#: src/top.ml:629 src/top.ml:626 src/main.ml:69 src/main.ml:44
+#: src/top.ml:622 src/top.ml:619 src/main.ml:69 src/main.ml:44
msgid "Error"
msgstr ""
-#: src/top.ml:125
+#: src/top.ml:118
msgid "Exit at given time"
msgstr ""
-#: src/top.ml:684
+#: src/top.ml:677
msgid "Help"
msgstr ""
-#: src/top.ml:127
+#: src/top.ml:120
msgid "Historical CPU delay"
msgstr ""
-#: src/top.ml:111
+#: src/top.ml:104
msgid "Log statistics to CSV file"
msgstr ""
-#: src/top.ml:667
+#: src/top.ml:660
msgid "MAIN KEYS"
msgstr ""
-#: src/top.ml:722
+#: src/top.ml:715
msgid "More help in virt-top(1) man page. Press any key to return."
msgstr ""
-#: src/top.ml:226
+#: src/top.ml:219
msgid ""
"NB: If you want to monitor a local hypervisor, you usually need to be root"
msgstr ""
@@ -207,87 +207,87 @@ msgstr ""
msgid "Net TX bytes"
msgstr ""
-#: src/top.ml:424
+#: src/top.ml:417
msgid "Not a valid number"
msgstr ""
-#: src/top.ml:133
+#: src/top.ml:126
msgid "Number of iterations to run"
msgstr ""
-#: src/top.ml:658 src/top.ml:657
+#: src/top.ml:651 src/top.ml:650
msgid "Off"
msgstr ""
-#: src/top.ml:658 src/top.ml:657
+#: src/top.ml:651 src/top.ml:650
msgid "On"
msgstr ""
-#: src/top.ml:682
+#: src/top.ml:675
msgid "Quit"
msgstr ""
-#: src/top.ml:140
+#: src/top.ml:133
msgid "Run from a script (no user interface)"
msgstr ""
-#: src/top.ml:689
+#: src/top.ml:682
msgid "SORTING"
msgstr ""
-#: src/top.ml:138
+#: src/top.ml:131
msgid "Secure (\"kiosk\") mode"
msgstr ""
-#: src/top.ml:698
+#: src/top.ml:691
msgid "Select sort field"
msgstr ""
-#: src/top.ml:123
+#: src/top.ml:116
msgid "Send debug messages to file"
msgstr ""
-#: src/top.ml:129
+#: src/top.ml:122
msgid "Set name of init file"
msgstr ""
-#: src/top.ml:135
+#: src/top.ml:128
msgid "Set sort order (%s)"
msgstr ""
-#: src/top.ml:432
+#: src/top.ml:425
msgid "Set sort order for main display"
msgstr ""
-#: src/top.ml:683
+#: src/top.ml:676
msgid "Set update interval"
msgstr ""
-#: src/top.ml:694
+#: src/top.ml:687
msgid "Sort by %CPU"
msgstr ""
-#: src/top.ml:695
+#: src/top.ml:688
msgid "Sort by %MEM"
msgstr ""
-#: src/top.ml:697
+#: src/top.ml:690
msgid "Sort by ID"
msgstr ""
-#: src/top.ml:696
+#: src/top.ml:689
msgid "Sort by TIME"
msgstr ""
-#: src/top.ml:103
+#: src/top.ml:96
msgid "Start by displaying block devices"
msgstr ""
-#: src/top.ml:101
+#: src/top.ml:94
msgid "Start by displaying network interfaces"
msgstr ""
-#: src/top.ml:99
+#: src/top.ml:92
msgid "Start by displaying pCPUs (default: tasks)"
msgstr ""
@@ -295,59 +295,55 @@ msgstr ""
msgid "TIME (CPU time)"
msgstr ""
-#: src/top.ml:718
+#: src/top.ml:711
msgid "Toggle block devices"
msgstr ""
-#: src/top.ml:717
+#: src/top.ml:710
msgid "Toggle network interfaces"
msgstr ""
-#: src/top.ml:716
+#: src/top.ml:709
msgid "Toggle physical CPUs"
msgstr ""
-#: src/top.ml:433
+#: src/top.ml:426
msgid "Type key or use up and down cursor keys."
msgstr ""
-#: src/top.ml:727
+#: src/top.ml:720
msgid "Unknown command - try 'h' for help"
msgstr ""
-#: src/top.ml:681
+#: src/top.ml:674
msgid "Update display"
msgstr ""
-#: src/top.ml:621
+#: src/top.ml:614
msgid "Wrote settings to %s"
msgstr ""
-#: src/top.ml:663
+#: src/top.ml:656
msgid "default"
msgstr ""
-#: src/top.ml:142
+#: src/top.ml:135
msgid "dump output to stdout (no userinterface)"
msgstr ""
-#: src/opt_xml.ml:46
-msgid "get_xml_desc didn't return <domain/>"
-msgstr ""
-
-#: src/top.ml:144
+#: src/top.ml:137
msgid "show block device load in bytes rather than reqs"
msgstr ""
-#: src/top.ml:685
+#: src/top.ml:678
msgid "toggle block info req/bytes"
msgstr ""
-#: src/top.ml:643
+#: src/top.ml:636
msgid "virt-top %s ocaml-libvirt %s libvirt %d.%d.%d by Red Hat"
msgstr ""
-#: src/top.ml:150
+#: src/top.ml:143
msgid ""
"virt-top : a 'top'-like utility for virtualization\n"
"\n"
@@ -358,9 +354,5 @@ msgid ""
msgstr ""
#: src/top.ml:39
-msgid "virt-top was compiled without support for CSV files"
-msgstr ""
-
-#: src/top.ml:46
msgid "virt-top was compiled without support for dates and times"
msgstr ""
diff --git a/src/.depend b/src/.depend
index ce785dd..aad72ab 100644
--- a/src/.depend
+++ b/src/.depend
@@ -1,19 +1,23 @@
# OCaml dependencies generated by ../ocaml-dep.sh
collect.cmo : \
+ xml.cmo \
utils.cmi \
types.cmi \
collect.cmi
collect.cmx : \
+ xml.cmx \
utils.cmx \
types.cmx \
collect.cmi
collect.cmi : \
types.cmi
csv_output.cmo : \
+ utils.cmi \
collect.cmi \
csv_output.cmi
csv_output.cmx : \
+ utils.cmx \
collect.cmx \
csv_output.cmi
csv_output.cmi : \
@@ -31,22 +35,8 @@ opt_calendar.cmo : \
opt_calendar.cmx : \
top.cmx \
opt_gettext.cmx
-opt_csv.cmo : \
- top.cmi \
- opt_gettext.cmo \
- csv_output.cmi
-opt_csv.cmx : \
- top.cmx \
- opt_gettext.cmx \
- csv_output.cmx
opt_gettext.cmo :
opt_gettext.cmx :
-opt_xml.cmo : \
- opt_gettext.cmo \
- collect.cmi
-opt_xml.cmx : \
- opt_gettext.cmx \
- collect.cmx
redraw.cmo : \
utils.cmi \
types.cmi \
@@ -122,3 +112,5 @@ utils.cmx : \
utils.cmi :
version.cmo :
version.cmx :
+xml.cmo :
+xml.cmx :
diff --git a/src/Makefile.am b/src/Makefile.am
index 32a51ac..baf8ce4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,12 +24,9 @@ EXTRA_DIST = \
collect.mli \
csv_output.ml \
csv_output.mli \
- dummy.c \
main.ml \
opt_calendar.ml \
- opt_csv.ml \
opt_gettext.ml \
- opt_xml.ml \
redraw.ml \
redraw.mli \
screen.ml \
@@ -43,9 +40,11 @@ EXTRA_DIST = \
utils.ml \
utils.mli \
version.ml \
- virt-top.pod
+ virt-top.pod \
+ xml-c.c \
+ xml.ml
-OCAMLPACKAGES = -package unix,extlib,curses,str,libvirt
+OCAMLPACKAGES = -package unix,curses,str,libvirt
if HAVE_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
@@ -56,20 +55,13 @@ BOBJS = \
opt_gettext.cmo \
utils.cmo \
types.cmo \
+ xml.cmo \
collect.cmo \
screen.cmo \
redraw.cmo \
csv_output.cmo \
stream_output.cmo \
top.cmo
-if HAVE_PKG_XML_LIGHT
-BOBJS += opt_xml.cmo
-OCAMLPACKAGES += -package xml-light
-endif
-if HAVE_PKG_CSV
-BOBJS += opt_csv.cmo
-OCAMLPACKAGES += -package csv
-endif
if HAVE_PKG_CALENDAR
BOBJS += opt_calendar.cmo
OCAMLPACKAGES += -package calendar
@@ -78,12 +70,18 @@ BOBJS += main.cmo
XOBJS = $(BOBJS:.cmo=.cmx)
-OCAMLFLAGS = -g -warn-error CDEFLMPSUVYZX-3 -ccopt '@CFLAGS@'
-OCAMLLIBS =
+OCAMLFLAGS = \
+ -g \
+ -warn-error +C+D+E+F+L+M+P+S+U+V+Y+Z+X-3 \
+ -ccopt '$(CFLAGS)'
+OCAMLLIBS = $(LIBXML2_LIBS)
bin_PROGRAMS = virt-top
-virt_top_SOURCES = dummy.c
+virt_top_SOURCES = xml-c.c
+virt_top_CFLAGS = \
+ $(LIBXML2_CFLAGS) \
+ -I$(libdir)/ocaml
if !HAVE_OCAMLOPT
OBJECTS = $(BOBJS)
diff --git a/src/Makefile.in b/src/Makefile.in
index d5480dc..c85cc32 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -106,14 +106,10 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@HAVE_PKG_GETTEXT_TRUE@am__append_1 = -package gettext-stub
-@HAVE_PKG_XML_LIGHT_TRUE@am__append_2 = opt_xml.cmo
-@HAVE_PKG_XML_LIGHT_TRUE@am__append_3 = -package xml-light
-@HAVE_PKG_CSV_TRUE@am__append_4 = opt_csv.cmo
-@HAVE_PKG_CSV_TRUE@am__append_5 = -package csv
-@HAVE_PKG_CALENDAR_TRUE@am__append_6 = opt_calendar.cmo
-@HAVE_PKG_CALENDAR_TRUE@am__append_7 = -package calendar
+@HAVE_PKG_CALENDAR_TRUE@am__append_2 = opt_calendar.cmo
+@HAVE_PKG_CALENDAR_TRUE@am__append_3 = -package calendar
bin_PROGRAMS = virt-top$(EXEEXT)
-@HAVE_PERLDOC_TRUE@am__append_8 = virt-top.1 virt-top.txt
+@HAVE_PERLDOC_TRUE@am__append_4 = virt-top.1 virt-top.txt
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ocaml.m4 \
@@ -127,7 +123,7 @@ CONFIG_CLEAN_FILES = version.ml
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
-am_virt_top_OBJECTS = dummy.$(OBJEXT)
+am_virt_top_OBJECTS = virt_top-xml-c.$(OBJEXT)
virt_top_OBJECTS = $(am_virt_top_OBJECTS)
virt_top_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@)
@@ -145,8 +141,12 @@ am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ./$(DEPDIR)/dummy.Po
+am__depfiles_remade = ./$(DEPDIR)/virt_top-xml-c.Po
am__mv = mv -f
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
@@ -225,6 +225,8 @@ LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
@@ -251,13 +253,10 @@ OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@
OCAMLVERSION = @OCAMLVERSION@
OCAML_GETTEXT = @OCAML_GETTEXT@
OCAML_PKG_calendar = @OCAML_PKG_calendar@
-OCAML_PKG_csv = @OCAML_PKG_csv@
OCAML_PKG_curses = @OCAML_PKG_curses@
-OCAML_PKG_extlib = @OCAML_PKG_extlib@
OCAML_PKG_gettext = @OCAML_PKG_gettext@
OCAML_PKG_libvirt = @OCAML_PKG_libvirt@
OCAML_PKG_unix = @OCAML_PKG_unix@
-OCAML_PKG_xml_light = @OCAML_PKG_xml_light@
OCAML_RUNTIME_VARIANT_PIC_OPTION = @OCAML_RUNTIME_VARIANT_PIC_OPTION@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -267,6 +266,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -329,19 +331,16 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
CLEANFILES = *~ *.bak *.orig *.rej *.cmi *.cmo *.cma *.cmx *.cmxa \
- dll*.so *.a *.annot $(am__append_8)
+ dll*.so *.a *.annot $(am__append_4)
EXTRA_DIST = \
.depend \
collect.ml \
collect.mli \
csv_output.ml \
csv_output.mli \
- dummy.c \
main.ml \
opt_calendar.ml \
- opt_csv.ml \
opt_gettext.ml \
- opt_xml.ml \
redraw.ml \
redraw.mli \
screen.ml \
@@ -355,18 +354,27 @@ EXTRA_DIST = \
utils.ml \
utils.mli \
version.ml \
- virt-top.pod
-
-OCAMLPACKAGES = -package unix,extlib,curses,str,libvirt \
- $(am__append_1) $(am__append_3) $(am__append_5) \
- $(am__append_7)
-BOBJS = version.cmo opt_gettext.cmo utils.cmo types.cmo collect.cmo \
- screen.cmo redraw.cmo csv_output.cmo stream_output.cmo top.cmo \
- $(am__append_2) $(am__append_4) $(am__append_6) main.cmo
+ virt-top.pod \
+ xml-c.c \
+ xml.ml
+
+OCAMLPACKAGES = -package unix,curses,str,libvirt $(am__append_1) \
+ $(am__append_3)
+BOBJS = version.cmo opt_gettext.cmo utils.cmo types.cmo xml.cmo \
+ collect.cmo screen.cmo redraw.cmo csv_output.cmo \
+ stream_output.cmo top.cmo $(am__append_2) main.cmo
XOBJS = $(BOBJS:.cmo=.cmx)
-OCAMLFLAGS = -g -warn-error CDEFLMPSUVYZX-3 -ccopt '@CFLAGS@'
-OCAMLLIBS =
-virt_top_SOURCES = dummy.c
+OCAMLFLAGS = \
+ -g \
+ -warn-error +C+D+E+F+L+M+P+S+U+V+Y+Z+X-3 \
+ -ccopt '$(CFLAGS)'
+
+OCAMLLIBS = $(LIBXML2_LIBS)
+virt_top_SOURCES = xml-c.c
+virt_top_CFLAGS = \
+ $(LIBXML2_CFLAGS) \
+ -I$(libdir)/ocaml
+
@HAVE_OCAMLOPT_FALSE@OBJECTS = $(BOBJS)
@HAVE_OCAMLOPT_TRUE@OBJECTS = $(XOBJS)
virt_top_DEPENDENCIES = $(OBJECTS)
@@ -463,7 +471,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virt_top-xml-c.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@@ -485,6 +493,20 @@ am--depfiles: $(am__depfiles_remade)
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+virt_top-xml-c.o: xml-c.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_top_CFLAGS) $(CFLAGS) -MT virt_top-xml-c.o -MD -MP -MF $(DEPDIR)/virt_top-xml-c.Tpo -c -o virt_top-xml-c.o `test -f 'xml-c.c' || echo '$(srcdir)/'`xml-c.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_top-xml-c.Tpo $(DEPDIR)/virt_top-xml-c.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xml-c.c' object='virt_top-xml-c.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_top_CFLAGS) $(CFLAGS) -c -o virt_top-xml-c.o `test -f 'xml-c.c' || echo '$(srcdir)/'`xml-c.c
+
+virt_top-xml-c.obj: xml-c.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_top_CFLAGS) $(CFLAGS) -MT virt_top-xml-c.obj -MD -MP -MF $(DEPDIR)/virt_top-xml-c.Tpo -c -o virt_top-xml-c.obj `if test -f 'xml-c.c'; then $(CYGPATH_W) 'xml-c.c'; else $(CYGPATH_W) '$(srcdir)/xml-c.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/virt_top-xml-c.Tpo $(DEPDIR)/virt_top-xml-c.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xml-c.c' object='virt_top-xml-c.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(virt_top_CFLAGS) $(CFLAGS) -c -o virt_top-xml-c.obj `if test -f 'xml-c.c'; then $(CYGPATH_W) 'xml-c.c'; else $(CYGPATH_W) '$(srcdir)/xml-c.c'; fi`
+
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
@@ -613,7 +635,7 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
- -rm -f ./$(DEPDIR)/dummy.Po
+ -rm -f ./$(DEPDIR)/virt_top-xml-c.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -659,7 +681,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f ./$(DEPDIR)/dummy.Po
+ -rm -f ./$(DEPDIR)/virt_top-xml-c.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/src/README b/src/README
index 1fd4be3..e49fd48 100644
--- a/src/README
+++ b/src/README
@@ -41,23 +41,10 @@ The code is structured into these files:
to deal with keypresses, help screens and so on.
opt_gettext.ml
+
A generated file which adds gettext support if ocaml-gettext
was found at configure time, or else stubs it out.
- opt_xml.ml
-
- Any code which needs the optional xml-light library goes
- in here. Mainly for parsing domain XML descriptions to get
- the list of block devices and network interfaces.
-
- The reason for having it in a separate file is so that we
- don't depend on xml-light.
-
- opt_csv.ml
-
- Any code which needs the optional ocaml-csv library goes
- in here.
-
opt_calendar.ml
Any code which needs the optional ocaml-calendar library
@@ -67,7 +54,7 @@ The code is structured into these files:
main.ml
This is just a small bit of code to glue the modules together
- Top + Opt_xml? + Opt_csv? + Opt_calendar?
+ Top + Opt_calendar?
The man-page is generated from the single file:
diff --git a/src/collect.ml b/src/collect.ml
index a1e50a1..7d1aadc 100644
--- a/src/collect.ml
+++ b/src/collect.ml
@@ -1,5 +1,5 @@
(* 'top'-like tool for libvirt domains.
- (C) Copyright 2007-2017 Richard W.M. Jones, Red Hat Inc.
+ (C) Copyright 2007-2021 Richard W.M. Jones, Red Hat Inc.
http://libvirt.org/
This program is free software; you can redistribute it and/or modify
@@ -21,17 +21,10 @@ module C = Libvirt.Connect
module D = Libvirt.Domain
open Printf
-open ExtList
open Utils
open Types
-(* Hook for XML support (see [opt_xml.ml]). *)
-let parse_device_xml : (int -> [>`R] D.t -> string list * string list) ref =
- ref (
- fun _ _ -> [], []
- )
-
(* Intermediate "domain + stats" structure that we use to collect
* everything we know about a domain within the collect function.
*)
@@ -95,7 +88,7 @@ let devices = Hashtbl.create 13
let get_devices id dom =
try Hashtbl.find devices id
with Not_found ->
- let blkdevs, netifs = (!parse_device_xml) id dom in
+ let blkdevs, netifs = Xml.parse_device_xml dom in
Hashtbl.replace devices id (blkdevs, netifs);
blkdevs, netifs
@@ -144,174 +137,185 @@ let collect (conn, _, _, _, _, node_info, _, _) =
let doms = Array.to_list doms in
List.map (
fun { D.dom_uuid = uuid; D.params = params } ->
- let nr_params = Array.length params in
- let get_param name =
- let rec loop i =
- if i = nr_params then None
- else if fst params.(i) = name then Some (snd params.(i))
- else loop (i+1)
+ try
+ let nr_params = Array.length params in
+ let get_param name =
+ let rec loop i =
+ if i = nr_params then None
+ else if fst params.(i) = name then Some (snd params.(i))
+ else loop (i+1)
+ in
+ loop 0
+ in
+ let get_param_int name default =
+ match get_param name with
+ | None -> None
+ | Some (D.TypedFieldInt32 i)
+ | Some (D.TypedFieldUInt32 i) -> Some (Int32.to_int i)
+ | Some (D.TypedFieldInt64 i)
+ | Some (D.TypedFieldUInt64 i) -> Some (Int64.to_int i)
+ | _ -> default
in
- loop 0
- in
- let get_param_int name default =
- match get_param name with
- | None -> None
- | Some (D.TypedFieldInt32 i)
- | Some (D.TypedFieldUInt32 i) -> Some (Int32.to_int i)
- | Some (D.TypedFieldInt64 i)
- | Some (D.TypedFieldUInt64 i) -> Some (Int64.to_int i)
- | _ -> default
- in
- let get_param_int64 name default =
- match get_param name with
- | None -> None
- | Some (D.TypedFieldInt32 i)
- | Some (D.TypedFieldUInt32 i) -> Some (Int64.of_int32 i)
- | Some (D.TypedFieldInt64 i)
- | Some (D.TypedFieldUInt64 i) -> Some i
- | _ -> default
- in
-
- let dom = D.lookup_by_uuid conn uuid in
- let id = D.get_id dom in
- let name = D.get_name dom in
- let state = get_param_int "state.state" None in
-
- if state = Some 5 (* VIR_DOMAIN_SHUTOFF *) then
- (name, Inactive)
- else (
- (* Active domain. *)
-
- (* Synthesize a D.info struct out of the data we have
- * from virConnectGetAllDomainStats. Doing this is an
- * artifact from the old APIs we used to use to fetch
- * stats, we could simplify here, and also return the
- * RSS memory. XXX
- *)
- let state =
- match state with
- | None | Some 0 -> D.InfoNoState
- | Some 1 -> D.InfoRunning
- | Some 2 -> D.InfoBlocked
- | Some 3 -> D.InfoPaused
- | Some 4 -> D.InfoShutdown
- | Some 5 -> D.InfoShutoff
- | Some 6 -> D.InfoCrashed
- | Some 7 -> D.InfoPaused (* XXX really VIR_DOMAIN_PMSUSPENDED *)
- | _ -> D.InfoNoState in
- let memory =
- match get_param_int64 "balloon.current" None with
- | None -> 0_L
- | Some m -> m in
- let nr_virt_cpu =
- match get_param_int "vcpu.current" None with
- | None -> 1
- | Some v -> v in
- let cpu_time =
- (* NB: libvirt does not return cpu.time for non-root domains. *)
- match get_param_int64 "cpu.time" None with
- | None -> 0_L
- | Some ns -> ns in
- let info = {
- D.state = state;
- max_mem = -1_L; (* not used anywhere in virt-top *)
- memory = memory;
- nr_virt_cpu = nr_virt_cpu;
- cpu_time = cpu_time
- } in
-
- let nr_block_devs =
- match get_param_int "block.count" None with
- | None -> 0
- | Some i -> i in
- let block_stats =
- List.map (
- fun i ->
- let dev =
- match get_param (sprintf "block.%d.name" i) with
- | None -> sprintf "blk%d" i
- | Some (D.TypedFieldString s) -> s
- | _ -> assert false in
- dev, {
- D.rd_req =
- (match get_param_int64 (sprintf "block.%d.rd.reqs" i) None
- with None -> 0_L | Some v -> v);
- rd_bytes =
- (match get_param_int64 (sprintf "block.%d.rd.bytes" i) None
- with None -> 0_L | Some v -> v);
- wr_req =
- (match get_param_int64 (sprintf "block.%d.wr.reqs" i) None
- with None -> 0_L | Some v -> v);
- wr_bytes =
- (match get_param_int64 (sprintf "block.%d.wr.bytes" i) None
- with None -> 0_L | Some v -> v);
- errs = 0_L
- }
- ) (range 0 (nr_block_devs-1)) in
-
- let nr_interface_devs =
- match get_param_int "net.count" None with
- | None -> 0
- | Some i -> i in
- let interface_stats =
- List.map (
- fun i ->
- let dev =
- match get_param (sprintf "net.%d.name" i) with
- | None -> sprintf "net%d" i
- | Some (D.TypedFieldString s) -> s
- | _ -> assert false in
- dev, {
- D.rx_bytes =
- (match get_param_int64 (sprintf "net.%d.rx.bytes" i) None
- with None -> 0_L | Some v -> v);
- rx_packets =
- (match get_param_int64 (sprintf "net.%d.rx.pkts" i) None
- with None -> 0_L | Some v -> v);
- rx_errs =
- (match get_param_int64 (sprintf "net.%d.rx.errs" i) None
- with None -> 0_L | Some v -> v);
- rx_drop =
- (match get_param_int64 (sprintf "net.%d.rx.drop" i) None
- with None -> 0_L | Some v -> v);
- tx_bytes =
- (match get_param_int64 (sprintf "net.%d.tx.bytes" i) None
- with None -> 0_L | Some v -> v);
- tx_packets =
- (match get_param_int64 (sprintf "net.%d.tx.pkts" i) None
- with None -> 0_L | Some v -> v);
- tx_errs =
- (match get_param_int64 (sprintf "net.%d.tx.errs" i) None
- with None -> 0_L | Some v -> v);
- tx_drop =
- (match get_param_int64 (sprintf "net.%d.tx.drop" i) None
- with None -> 0_L | Some v -> v);
- }
- ) (range 0 (nr_interface_devs-1)) in
-
- let prev_info, prev_block_stats, prev_interface_stats =
- try
- let prev_info, prev_block_stats, prev_interface_stats =
- Hashtbl.find last_info uuid in
- Some prev_info, prev_block_stats, prev_interface_stats
- with Not_found -> None, [], [] in
-
- (name,
- Active {
- rd_domid = id; rd_domuuid = uuid; rd_dom = dom;
- rd_info = info;
- rd_block_stats = block_stats;
- rd_interface_stats = interface_stats;
- rd_prev_info = prev_info;
- rd_prev_block_stats = prev_block_stats;
- rd_prev_interface_stats = prev_interface_stats;
- rd_cpu_time = 0.; rd_percent_cpu = 0.;
- rd_mem_bytes = 0L; rd_mem_percent = 0L;
- rd_block_rd_reqs = None; rd_block_wr_reqs = None;
- rd_block_rd_bytes = None; rd_block_wr_bytes = None;
- rd_net_rx_bytes = None; rd_net_tx_bytes = None;
- })
- )
+ let get_param_int64 name default =
+ match get_param name with
+ | None -> None
+ | Some (D.TypedFieldInt32 i)
+ | Some (D.TypedFieldUInt32 i) -> Some (Int64.of_int32 i)
+ | Some (D.TypedFieldInt64 i)
+ | Some (D.TypedFieldUInt64 i) -> Some i
+ | _ -> default
+ in
+
+ let dom = D.lookup_by_uuid conn uuid in
+ let id = D.get_id dom in
+ let name = D.get_name dom in
+ let state = get_param_int "state.state" None in
+
+ if state = Some 5 (* VIR_DOMAIN_SHUTOFF *) then
+ (name, Inactive)
+ else (
+ (* Active domain. *)
+
+ (* Synthesize a D.info struct out of the data we have
+ * from virConnectGetAllDomainStats. Doing this is an
+ * artifact from the old APIs we used to use to fetch
+ * stats, we could simplify here, and also return the
+ * RSS memory. XXX
+ *)
+ let state =
+ match state with
+ | None | Some 0 -> D.InfoNoState
+ | Some 1 -> D.InfoRunning
+ | Some 2 -> D.InfoBlocked
+ | Some 3 -> D.InfoPaused
+ | Some 4 -> D.InfoShutdown
+ | Some 5 -> D.InfoShutoff
+ | Some 6 -> D.InfoCrashed
+ | Some 7 -> D.InfoPaused (* XXX really VIR_DOMAIN_PMSUSPENDED *)
+ | _ -> D.InfoNoState in
+ let memory =
+ match get_param_int64 "balloon.current" None with
+ | None -> 0_L
+ | Some m -> m in
+ let nr_virt_cpu =
+ match get_param_int "vcpu.current" None with
+ | None -> 1
+ | Some v -> v in
+ let cpu_time =
+ (* NB: libvirt does not return cpu.time for non-root domains. *)
+ match get_param_int64 "cpu.time" None with
+ | None -> 0_L
+ | Some ns -> ns in
+ let info = {
+ D.state = state;
+ max_mem = -1_L; (* not used anywhere in virt-top *)
+ memory = memory;
+ nr_virt_cpu = nr_virt_cpu;
+ cpu_time = cpu_time
+ } in
+
+ let nr_block_devs =
+ match get_param_int "block.count" None with
+ | None -> 0
+ | Some i -> i in
+ let block_stats =
+ List.map (
+ fun i ->
+ let dev =
+ match get_param (sprintf "block.%d.name" i) with
+ | None -> sprintf "blk%d" i
+ | Some (D.TypedFieldString s) -> s
+ | _ -> assert false in
+ dev, {
+ D.rd_req =
+ (let n = sprintf "block.%d.rd.reqs" i in
+ match get_param_int64 n None
+ with None -> 0_L | Some v -> v);
+ rd_bytes =
+ (let n = sprintf "block.%d.rd.bytes" i in
+ match get_param_int64 n None
+ with None -> 0_L | Some v -> v);
+ wr_req =
+ (let n = sprintf "block.%d.wr.reqs" i in
+ match get_param_int64 n None
+ with None -> 0_L | Some v -> v);
+ wr_bytes =
+ (let n = sprintf "block.%d.wr.bytes" i in
+ match get_param_int64 n None
+ with None -> 0_L | Some v -> v);
+ errs = 0_L
+ }
+ ) (range 0 (nr_block_devs-1)) in
+
+ let nr_interface_devs =
+ match get_param_int "net.count" None with
+ | None -> 0
+ | Some i -> i in
+ let interface_stats =
+ List.map (
+ fun i ->
+ let dev =
+ match get_param (sprintf "net.%d.name" i) with
+ | None -> sprintf "net%d" i
+ | Some (D.TypedFieldString s) -> s
+ | _ -> assert false in
+ dev, {
+ D.rx_bytes =
+ (match get_param_int64 (sprintf "net.%d.rx.bytes" i) None
+ with None -> 0_L | Some v -> v);
+ rx_packets =
+ (match get_param_int64 (sprintf "net.%d.rx.pkts" i) None
+ with None -> 0_L | Some v -> v);
+ rx_errs =
+ (match get_param_int64 (sprintf "net.%d.rx.errs" i) None
+ with None -> 0_L | Some v -> v);
+ rx_drop =
+ (match get_param_int64 (sprintf "net.%d.rx.drop" i) None
+ with None -> 0_L | Some v -> v);
+ tx_bytes =
+ (match get_param_int64 (sprintf "net.%d.tx.bytes" i) None
+ with None -> 0_L | Some v -> v);
+ tx_packets =
+ (match get_param_int64 (sprintf "net.%d.tx.pkts" i) None
+ with None -> 0_L | Some v -> v);
+ tx_errs =
+ (match get_param_int64 (sprintf "net.%d.tx.errs" i) None
+ with None -> 0_L | Some v -> v);
+ tx_drop =
+ (match get_param_int64 (sprintf "net.%d.tx.drop" i) None
+ with None -> 0_L | Some v -> v);
+ }
+ ) (range 0 (nr_interface_devs-1)) in
+
+ let prev_info, prev_block_stats, prev_interface_stats =
+ try
+ let prev_info, prev_block_stats, prev_interface_stats =
+ Hashtbl.find last_info uuid in
+ Some prev_info, prev_block_stats, prev_interface_stats
+ with Not_found -> None, [], [] in
+
+ (name,
+ Active {
+ rd_domid = id; rd_domuuid = uuid; rd_dom = dom;
+ rd_info = info;
+ rd_block_stats = block_stats;
+ rd_interface_stats = interface_stats;
+ rd_prev_info = prev_info;
+ rd_prev_block_stats = prev_block_stats;
+ rd_prev_interface_stats = prev_interface_stats;
+ rd_cpu_time = 0.; rd_percent_cpu = 0.;
+ rd_mem_bytes = 0L; rd_mem_percent = 0L;
+ rd_block_rd_reqs = None; rd_block_wr_reqs = None;
+ rd_block_rd_bytes = None; rd_block_wr_bytes = None;
+ rd_net_rx_bytes = None; rd_net_tx_bytes = None;
+ })
+ )
+ with
+ Libvirt.Virterror _ ->
+ (* this can happen if a domain goes away while we
+ * are reading it, just report an inactive domain
+ *)
+ ("", Inactive)
) doms in
(* Calculate the CPU time (ns) and %CPU used by each domain. *)
diff --git a/src/collect.mli b/src/collect.mli
index 3c5492f..72f0800 100644
--- a/src/collect.mli
+++ b/src/collect.mli
@@ -17,10 +17,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
-(* Hook for [Opt_xml] to override (if present). *)
-val parse_device_xml :
- (int -> [ `R ] Libvirt.Domain.t -> string list * string list) ref
-
(* Intermediate "domain + stats" structure that we use to collect
* everything we know about a domain within the collect function.
*)
diff --git a/src/csv_output.ml b/src/csv_output.ml
index f23d673..42fed9d 100644
--- a/src/csv_output.ml
+++ b/src/csv_output.ml
@@ -1,5 +1,5 @@
(* 'top'-like tool for libvirt domains.
- (C) Copyright 2007-2017 Richard W.M. Jones, Red Hat Inc.
+ (C) Copyright 2007-2021 Richard W.M. Jones, Red Hat Inc.
http://libvirt.org/
This program is free software; you can redistribute it and/or modify
@@ -20,21 +20,103 @@
(* CSV output functions. *)
open Printf
-open ExtList
+open Utils
open Collect
module C = Libvirt.Connect
-(* Hook for CSV support (see [opt_csv.ml]). *)
-let csv_write : (string list -> unit) ref =
- ref (
- fun _ -> ()
+let chan = ref None
+
+let csv_set_filename filename = chan := Some (open_out filename)
+
+(* This code is adapted from OCaml CSV, published under the LGPLv2+
+ * which is compatible with the license of virt-top.
+ *)
+
+let nl = Bytes.make 1 '\n'
+let comma = Bytes.make 1 ','
+let quote = Bytes.make 1 '"'
+let output_newline chan = output chan nl 0 1
+let output_comma chan = output chan comma 0 1
+let output_quote chan = output chan quote 0 1
+
+let is_space_or_tab c = c = ' ' || c = '\t'
+
+let must_escape = Array.make 256 false
+let () =
+ List.iter (fun c -> must_escape.(Char.code c) <- true)
+ ['\"'; '\\'; '\000'; '\b'; '\n'; '\r'; '\t'; '\026']
+
+let must_quote chan s len =
+ let quote = ref (is_space_or_tab (String.unsafe_get s 0)
+ || is_space_or_tab (String.unsafe_get s (len - 1))) in
+ let n = ref 0 in
+ for i = 0 to len-1 do
+ let c = String.unsafe_get s i in
+ if c = ',' || c = '\n' || c = '\r' then quote := true
+ else if c = '"' then (
+ quote := true;
+ incr n
+ )
+ done;
+ if !quote then !n else -1
+
+let write_escaped chan field =
+ let len = String.length field in
+ if len > 0 then (
+ let n = must_quote chan field len in
+ if n < 0 then
+ output chan (Bytes.unsafe_of_string field) 0 len
+ else (
+ let field =
+ if n <= 0 then Bytes.unsafe_of_string field
+ else (* There are some quotes to escape *)
+ let s = Bytes.create (len + n) in
+ let j = ref 0 in
+ for i = 0 to len - 1 do
+ let c = String.unsafe_get field i in
+ if c = '"' then (
+ Bytes.unsafe_set s !j '"'; incr j;
+ Bytes.unsafe_set s !j '"'; incr j
+ )
+ else (Bytes.unsafe_set s !j c; incr j)
+ done;
+ s
+ in
+ output_quote chan;
+ output chan field 0 (Bytes.length field);
+ output_quote chan
+ )
)
+let save_out chan = function
+ | [] -> output_newline chan
+ | [f] ->
+ write_escaped chan f;
+ output_newline chan
+ | f :: tl ->
+ write_escaped chan f;
+ List.iter (
+ fun f ->
+ output_comma chan;
+ write_escaped chan f
+ ) tl;
+ output_newline chan
+
+let csv_write row =
+ match !chan with
+ | None -> () (* CSV output not enabled *)
+ | Some chan ->
+ save_out chan row;
+ (* Flush the output to the file immediately because we don't
+ * explicitly close the channel.
+ *)
+ flush chan
+
(* Write CSV header row. *)
let write_csv_header (csv_cpu, csv_mem, csv_block, csv_net) block_in_bytes =
- (!csv_write) (
+ csv_write (
[ "Hostname"; "Time"; "Arch"; "Physical CPUs";
"Count"; "Running"; "Blocked"; "Paused"; "Shutdown";
"Shutoff"; "Crashed"; "Active"; "Inactive";
@@ -92,9 +174,9 @@ let append_csv (_, _, _, _, _, node_info, hostname, _) (* setup *)
let cmp (_, { rd_domid = rd_domid1 }) (_, { rd_domid = rd_domid2 }) =
compare rd_domid1 rd_domid2
in
- let doms = List.sort ~cmp doms in
+ let doms = List.sort cmp doms in
- let string_of_int64_option = Option.map_default Int64.to_string "" in
+ let string_of_int64_option = map_default Int64.to_string "" in
let domain_fields = List.map (
fun (domname, rd) ->
@@ -121,4 +203,4 @@ let append_csv (_, _, _, _, _, node_info, hostname, _) (* setup *)
) doms in
let domain_fields = List.flatten domain_fields in
- (!csv_write) (summary_fields @ domain_fields)
+ csv_write (summary_fields @ domain_fields)
diff --git a/src/csv_output.mli b/src/csv_output.mli
index 4064be5..71838eb 100644
--- a/src/csv_output.mli
+++ b/src/csv_output.mli
@@ -1,5 +1,5 @@
(* 'top'-like tool for libvirt domains.
- (C) Copyright 2007-2017 Richard W.M. Jones, Red Hat Inc.
+ (C) Copyright 2007-2021 Richard W.M. Jones, Red Hat Inc.
http://libvirt.org/
This program is free software; you can redistribute it and/or modify
@@ -19,8 +19,7 @@
(** CSV output functions. *)
-(* Hook for [Opt_csv] to override (if present). *)
-val csv_write : (string list -> unit) ref
+val csv_set_filename : string -> unit
val write_csv_header : bool * bool * bool * bool -> bool -> unit
diff --git a/src/dummy.c b/src/dummy.c
deleted file mode 100644
index ebab619..0000000
--- a/src/dummy.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Dummy source, to be used for OCaml-based tools with no C sources. */
-enum { foo = 1 };
diff --git a/src/opt_calendar.ml b/src/opt_calendar.ml
index fd93704..89c5598 100644
--- a/src/opt_calendar.ml
+++ b/src/opt_calendar.ml
@@ -22,14 +22,18 @@
open CalendarLib
open Printf
-open ExtString
open Opt_gettext.Gettext ;;
Top.parse_date_time :=
fun time ->
let cal : Calendar.t =
- if String.starts_with time "+" then ( (* +something *)
+ (* time is "+something" *)
+ let is_plus =
+ let n = String.length time in
+ n >= 1 && time.[0] = '+'
+ in
+ if is_plus then (
let period = String.sub time 1 (String.length time - 1) in
let period =
if String.contains period ':' then ( (* +HH:MM:SS *)
diff --git a/src/opt_xml.ml b/src/opt_xml.ml
deleted file mode 100644
index 1037b85..0000000
--- a/src/opt_xml.ml
+++ /dev/null
@@ -1,69 +0,0 @@
-(* 'top'-like tool for libvirt domains.
- (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc.
- http://libvirt.org/
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- This file contains all code which requires xml-light.
-*)
-
-open ExtList
-
-open Opt_gettext.Gettext
-
-module C = Libvirt.Connect
-module D = Libvirt.Domain
-module N = Libvirt.Network ;;
-
-Collect.parse_device_xml :=
-fun id dom ->
- try
- let xml = D.get_xml_desc dom in
- let xml = Xml.parse_string xml in
- let devices =
- match xml with
- | Xml.Element ("domain", _, children) ->
- let devices =
- List.filter_map (
- function
- | Xml.Element ("devices", _, devices) -> Some devices
- | _ -> None
- ) children in
- List.concat devices
- | _ ->
- failwith (s_ "get_xml_desc didn't return <domain/>") in
- let rec target_dev_of = function
- | [] -> None
- | Xml.Element ("target", attrs, _) :: rest ->
- (try Some (List.assoc "dev" attrs)
- with Not_found -> target_dev_of rest)
- | _ :: rest -> target_dev_of rest
- in
- let blkdevs =
- List.filter_map (
- function
- | Xml.Element ("disk", _, children) -> target_dev_of children
- | _ -> None
- ) devices in
- let netifs =
- List.filter_map (
- function
- | Xml.Element ("interface", _, children) -> target_dev_of children
- | _ -> None
- ) devices in
- blkdevs, netifs
- with
- | Xml.Error _
- | Libvirt.Virterror _ -> [], [] (* ignore transient errs *)
diff --git a/src/redraw.ml b/src/redraw.ml
index 0403158..7031e66 100644
--- a/src/redraw.ml
+++ b/src/redraw.ml
@@ -17,7 +17,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
-open ExtList
open Curses
open Printf
@@ -137,7 +136,7 @@ let redraw display_mode sort_order
if r <> 0 then r
else compare name1 name2
in
- List.sort ~cmp doms in
+ List.sort cmp doms in
(* Print domains. *)
attron A.reverse;
@@ -316,7 +315,7 @@ let redraw display_mode sort_order
if r <> 0 then r
else compare (dev1, name1) (dev2, name2)
in
- List.sort ~cmp devs in
+ List.sort cmp devs in
(* Print the header for network devices. *)
attron A.reverse;
@@ -428,7 +427,7 @@ let redraw display_mode sort_order
if r <> 0 then r
else compare (dev1, name1) (dev2, name2)
in
- List.sort ~cmp devs in
+ List.sort cmp devs in
(* Print the header for block devices. *)
attron A.reverse;
@@ -491,7 +490,7 @@ let redraw display_mode sort_order
(* Time to grab another historical %CPU for the list? *)
if time >= !historical_cpu_last_time +. float historical_cpu_delay
then (
- historical_cpu := percent_cpu :: List.take 10 !historical_cpu;
+ historical_cpu := percent_cpu :: list_take 10 !historical_cpu;
historical_cpu_last_time := time
);
diff --git a/src/stream_output.ml b/src/stream_output.ml
index c3af99b..2b9e087 100644
--- a/src/stream_output.ml
+++ b/src/stream_output.ml
@@ -20,7 +20,6 @@
(* [--stream] mode output functions. *)
open Printf
-open ExtList
open Utils
open Collect
@@ -54,7 +53,7 @@ let append_stream (_, _, _, _, _, node_info, hostname, _) (* setup *)
| Inactive, Inactive -> 0)
in
let cmp (name1, dom1) (name2, dom2) = compare(dom1, dom2) in
- List.sort ~cmp doms in
+ List.sort cmp doms in
(*Print domains *)
let dump_domain = fun name rd
-> begin
diff --git a/src/top.ml b/src/top.ml
index c38239c..75fbcb9 100644
--- a/src/top.ml
+++ b/src/top.ml
@@ -18,7 +18,6 @@
*)
open Printf
-open ExtList
open Curses
open Opt_gettext.Gettext
@@ -33,12 +32,6 @@ module N = Libvirt.Network
let rcfile = ".virt-toprc"
-(* Hooks for CSV support (see [opt_csv.ml]). *)
-let csv_start : (string -> unit) ref =
- ref (
- fun _ -> failwith (s_"virt-top was compiled without support for CSV files")
- )
-
(* Hook for calendar support (see [opt_calendar.ml]). *)
let parse_date_time : (string -> float) ref =
ref (
@@ -84,7 +77,7 @@ let start_up () =
and set_net_mode () = display_mode := NetDisplay
and set_block_mode () = display_mode := BlockDisplay
and set_csv filename =
- (!csv_start) filename;
+ Csv_output.csv_set_filename filename;
csv_enabled := true
and no_init_file () = init_file := NoInitFile
and set_init_file filename = init_file := InitFile filename
diff --git a/src/top.mli b/src/top.mli
index b625910..f609325 100644
--- a/src/top.mli
+++ b/src/top.mli
@@ -17,9 +17,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
-(* Hook for [Opt_csv] to override (if present). *)
-val csv_start : (string -> unit) ref
-
(* Hook for [Opt_calendar] to override (if present). *)
val parse_date_time : (string -> float) ref
diff --git a/src/utils.ml b/src/utils.ml
index 4332ff7..1f00803 100644
--- a/src/utils.ml
+++ b/src/utils.ml
@@ -75,6 +75,14 @@ let trimr ?(test = isspace) str =
let trim ?(test = isspace) str =
trimr (triml str)
+(* Split string on the first instance of 'sep' character. *)
+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)
+ with
+ Not_found -> str, ""
+
(* Read a configuration file as a list of (key, value) pairs.
* If the config file is missing this returns an empty list.
*)
@@ -103,7 +111,7 @@ let read_config_file filename =
(* Convert to key, value pairs. *)
List.map (
fun (lineno, line) ->
- let key, value = ExtString.String.split line " " in
+ let key, value = split line ' ' in
lineno, trim key, trim value
) lines
@@ -117,6 +125,19 @@ let pad width str =
else (* if n < width then *) str ^ String.make (width-n) ' '
)
+(* Take up to n elements of xs, if available. *)
+let rec list_take n xs =
+ if n <= 0 then []
+ else (
+ match xs with
+ | [] -> []
+ | x :: xs -> x :: list_take (n-1) xs
+ )
+
+let map_default f def = function
+ | None -> def
+ | Some v -> f v
+
module Show = struct
(* Show a percentage in 4 chars. *)
let percent percent =
diff --git a/src/utils.mli b/src/utils.mli
index 3c966f8..2679dc9 100644
--- a/src/utils.mli
+++ b/src/utils.mli
@@ -36,6 +36,12 @@ val read_config_file : string -> (int * string * string) list
(* Pad or truncate a string to a fixed width. *)
val pad : int -> string -> string
+(* Take up to n elements of xs, if available. *)
+val list_take : int -> 'a list -> 'a list
+
+(* Apply function f to [Some v], return default for [None] *)
+val map_default : ('a -> 'b) -> 'b -> 'a option -> 'b
+
(* Int64 operators for convenience. *)
val (+^) : int64 -> int64 -> int64
val (-^) : int64 -> int64 -> int64
diff --git a/src/version.ml b/src/version.ml
index 484cdb1..0c56d4b 100644
--- a/src/version.ml
+++ b/src/version.ml
@@ -19,4 +19,4 @@
This file contains all code which requires CSV support.
*)
-let version = "1.1.0"
+let version = "1.1.1"
diff --git a/src/virt-top.pod b/src/virt-top.pod
index 76ad3f9..315b9b6 100644
--- a/src/virt-top.pod
+++ b/src/virt-top.pod
@@ -114,10 +114,6 @@ Currently the statistics which this records vary between releases of
virt-top (but the column headers will stay the same, so you can use
those to process the CSV file).
-Not every version of virt-top supports CSV output - it depends how the
-program was compiled (see I<README> file in the source distribution
-for details).
-
To save space you can compress your CSV files (if your shell supports
this feature, eg. I<bash>):
diff --git a/src/xml-c.c b/src/xml-c.c
new file mode 100644
index 0000000..72042bf
--- /dev/null
+++ b/src/xml-c.c
@@ -0,0 +1,124 @@
+/* 'top'-like tool for libvirt domains.
+ (C) Copyright 2007-2021 Richard W.M. Jones, Red Hat Inc.
+ http://libvirt.org/
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <caml/alloc.h>
+#include <caml/fail.h>
+#include <caml/memory.h>
+#include <caml/mlvalues.h>
+
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+
+/* xpathobj contains a list of dev attributes, return the list
+ * as an OCaml array of strings.
+ */
+static value
+get_devs (xmlDocPtr doc, xmlXPathObjectPtr xpathobj)
+{
+ CAMLparam0 ();
+ CAMLlocal2 (rv, nodev);
+ const xmlNodeSetPtr nodes = xpathobj->nodesetval;
+ size_t i, nr_nodes;
+ xmlNodePtr node;
+ char *str;
+ xmlAttrPtr attr;
+
+ if (nodes == NULL || nodes->nodeNr == 0)
+ rv = caml_alloc (0, 0);
+ else {
+ /* Count the nodes that contain data. */
+ nr_nodes = 0;
+ for (i = 0; i < nodes->nodeNr; ++i) {
+ node = nodes->nodeTab[i];
+ if (node->type != XML_ATTRIBUTE_NODE)
+ continue;
+ nr_nodes++;
+ }
+
+ rv = caml_alloc (nr_nodes, 0);
+ nr_nodes = 0;
+ for (i = 0; i < nodes->nodeNr; ++i) {
+ node = nodes->nodeTab[i];
+ if (node->type != XML_ATTRIBUTE_NODE)
+ continue;
+ attr = (xmlAttrPtr) node;
+ str = (char *) xmlNodeListGetString (doc, attr->children, 1);
+ nodev = caml_copy_string (str);
+ free (str);
+ Store_field (rv, nr_nodes, nodev);
+ nr_nodes++;
+ }
+ }
+
+ CAMLreturn (rv);
+}
+
+/* external get_blk_net_devs : string -> string array * string array */
+value
+get_blk_net_devs (value xmlv)
+{
+ CAMLparam1 (xmlv);
+ CAMLlocal3 (rv, blkdevs, netifs);
+ xmlDocPtr doc;
+ xmlXPathContextPtr xpathctx;
+ xmlXPathObjectPtr xpathobj;
+ const char *expr;
+
+ /* For security reasons, call xmlReadMemory (not xmlParseMemory) and
+ * pass XML_PARSE_NONET.
+ */
+ doc = xmlReadMemory (String_val (xmlv), caml_string_length (xmlv),
+ NULL, NULL, XML_PARSE_NONET);
+ if (doc == NULL)
+ caml_invalid_argument ("xmlReadMemory: unable to parse XML");
+
+ xpathctx = xmlXPathNewContext (doc);
+ if (xpathctx == NULL)
+ caml_invalid_argument ("xmlXPathNewContext: unable to create new context");
+
+ expr = "//devices/disk/target/@dev";
+ xpathobj = xmlXPathEvalExpression (BAD_CAST expr, xpathctx);
+ if (xpathobj == NULL)
+ caml_invalid_argument (expr);
+
+ blkdevs = get_devs (doc, xpathobj);
+ xmlXPathFreeObject (xpathobj);
+
+ expr = "//devices/interface/target/@dev";
+ xpathobj = xmlXPathEvalExpression (BAD_CAST expr, xpathctx);
+ if (xpathobj == NULL)
+ caml_invalid_argument (expr);
+
+ netifs = get_devs (doc, xpathobj);
+ xmlXPathFreeObject (xpathobj);
+
+ xmlXPathFreeContext (xpathctx);
+ xmlFreeDoc (doc);
+
+ rv = caml_alloc (2, 0);
+ Store_field (rv, 0, blkdevs);
+ Store_field (rv, 1, netifs);
+ CAMLreturn (rv);
+}
diff --git a/src/opt_csv.ml b/src/xml.ml
index 6625c61..d11ce45 100644
--- a/src/opt_csv.ml
+++ b/src/xml.ml
@@ -1,5 +1,5 @@
(* 'top'-like tool for libvirt domains.
- (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc.
+ (C) Copyright 2007-2021 Richard W.M. Jones, Red Hat Inc.
http://libvirt.org/
This program is free software; you can redistribute it and/or modify
@@ -15,26 +15,18 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- This file contains all code which requires CSV support.
*)
-open Opt_gettext.Gettext
-
-(* Output channel, or None if CSV output not enabled. *)
-let chan = ref None ;;
+module D = Libvirt.Domain
-Top.csv_start :=
- fun filename ->
- chan := Some (open_out filename) ;;
+external get_blk_net_devs : string -> string array * string array
+ = "get_blk_net_devs"
-Csv_output.csv_write :=
- fun row ->
- match !chan with
- | None -> () (* CSV output not enabled. *)
- | Some chan ->
- Csv.save_out chan [row];
- (* Flush the output to the file immediately because we don't
- * explicitly close this file.
- *)
- flush chan
+let parse_device_xml dom =
+ try
+ let xml = D.get_xml_desc dom in
+ let blkdevs, netifs = get_blk_net_devs xml in
+ Array.to_list blkdevs, Array.to_list netifs
+ with
+ | Invalid_argument _
+ | Libvirt.Virterror _ -> [], [] (* ignore transient errors *)