From 8a8c035f78a41d68ba62bb35a6fba503481324e2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Add outline of 'virt-ps' command. --- .hgignore | 1 + MANIFEST | 4 ++++ Makefile.in | 3 ++- configure.ac | 1 + po/POTFILES | 1 + po/ja.po | 4 ++++ po/pl.po | 4 ++++ po/pt_BR.po | 4 ++++ po/virt-mem.pot | 6 +++++- ps/Makefile.in | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ps/virt_ps.ml | 36 +++++++++++++++++++++++++++++++ virt-ps.1 | 1 + 12 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 ps/Makefile.in create mode 100644 ps/virt_ps.ml create mode 100644 virt-ps.1 diff --git a/.hgignore b/.hgignore index a3a9b9b..771c749 100644 --- a/.hgignore +++ b/.hgignore @@ -26,4 +26,5 @@ po/*.po.bak po/*.po.orig uname/virt-uname dmesg/virt-dmesg +ps/virt-ps samples \ No newline at end of file diff --git a/MANIFEST b/MANIFEST index 3102f6e..1f8fcfe 100644 --- a/MANIFEST +++ b/MANIFEST @@ -25,6 +25,9 @@ po/virt-mem.pot po/ja.po po/pl.po po/pt_BR.po +ps/.depend +ps/Makefile.in +ps/virt_ps.ml README uname/.depend uname/Makefile.in @@ -33,4 +36,5 @@ virt-dmesg.1 virt-mem.1 virt-mem.pod virt-mem.txt +virt-ps.1 virt-uname.1 \ No newline at end of file diff --git a/Makefile.in b/Makefile.in index a2026de..8ccb0ef 100644 --- a/Makefile.in +++ b/Makefile.in @@ -26,7 +26,7 @@ mandir = @mandir@ HAVE_PERLDOC = @HAVE_PERLDOC@ -TOOLS = uname dmesg +TOOLS = uname dmesg ps ifeq ($(HAVE_PERLDOC),perldoc) MANPAGES = virt-mem.1 $(TOOLS:%=virt-%.1) @@ -63,6 +63,7 @@ clean: done rm -f uname/virt-uname rm -f dmesg/virt-dmesg + rm -f ps/virt-ps distclean: clean rm -f config.h config.log config.status configure diff --git a/configure.ac b/configure.ac index b281e5e..53287c4 100644 --- a/configure.ac +++ b/configure.ac @@ -139,6 +139,7 @@ AC_CONFIG_FILES([Makefile lib/virt_mem_version.ml uname/Makefile dmesg/Makefile + ps/Makefile po/Makefile ]) AC_OUTPUT diff --git a/po/POTFILES b/po/POTFILES index 531f88f..f2d7487 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,5 +1,6 @@ ../dmesg/virt_dmesg.ml ../uname/virt_uname.ml +../ps/virt_ps.ml ../lib/virt_mem_utils.ml ../lib/virt_mem_gettext.ml ../lib/virt_mem_version.ml diff --git a/po/ja.po b/po/ja.po index 2bd2935..49394b0 100644 --- a/po/ja.po +++ b/po/ja.po @@ -67,6 +67,10 @@ msgstr "" msgid "NAME\n virt-dmesg - dmesg command for virtual machines\n\nSUMMARY\n virt-dmesg [-options] [domains]\n\nDESCRIPTION\n virt-dmesg prints the kernel messages for virtual machines running\n under libvirt. The output is similar to the ordinary dmesg command\n run inside the virtual machine." msgstr "" +#: ../ps/virt_ps.ml:26 +msgid "NAME\n virt-ps - process listing command for virtual machines\n\nSUMMARY\n virt-ps [-options] [domains]\n\nDESCRIPTION\n virt-ps prints a process listing for virtual machines running under\n libvirt." +msgstr "" + #: ../uname/virt_uname.ml:26 msgid "NAME\n virt-uname - uname command for virtual machines\n\nSUMMARY\n virt-uname [-options] [domains]\n\nDESCRIPTION\n virt-uname prints the uname information such as OS version,\n architecture and node name for virtual machines running under\n libvirt." msgstr "" diff --git a/po/pl.po b/po/pl.po index 6fc8abe..5d9cb97 100644 --- a/po/pl.po +++ b/po/pl.po @@ -66,6 +66,10 @@ msgstr "Wyświetl wersję i zakończ" msgid "NAME\n virt-dmesg - dmesg command for virtual machines\n\nSUMMARY\n virt-dmesg [-options] [domains]\n\nDESCRIPTION\n virt-dmesg prints the kernel messages for virtual machines running\n under libvirt. The output is similar to the ordinary dmesg command\n run inside the virtual machine." msgstr "" +#: ../ps/virt_ps.ml:26 +msgid "NAME\n virt-ps - process listing command for virtual machines\n\nSUMMARY\n virt-ps [-options] [domains]\n\nDESCRIPTION\n virt-ps prints a process listing for virtual machines running under\n libvirt." +msgstr "" + #: ../uname/virt_uname.ml:26 msgid "NAME\n virt-uname - uname command for virtual machines\n\nSUMMARY\n virt-uname [-options] [domains]\n\nDESCRIPTION\n virt-uname prints the uname information such as OS version,\n architecture and node name for virtual machines running under\n libvirt." msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index c7c0e78..493cef3 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -70,6 +70,10 @@ msgstr "Exibe a versão e sai." msgid "NAME\n virt-dmesg - dmesg command for virtual machines\n\nSUMMARY\n virt-dmesg [-options] [domains]\n\nDESCRIPTION\n virt-dmesg prints the kernel messages for virtual machines running\n under libvirt. The output is similar to the ordinary dmesg command\n run inside the virtual machine." msgstr "" +#: ../ps/virt_ps.ml:26 +msgid "NAME\n virt-ps - process listing command for virtual machines\n\nSUMMARY\n virt-ps [-options] [domains]\n\nDESCRIPTION\n virt-ps prints a process listing for virtual machines running under\n libvirt." +msgstr "" + #: ../uname/virt_uname.ml:26 msgid "NAME\n virt-uname - uname command for virtual machines\n\nSUMMARY\n virt-uname [-options] [domains]\n\nDESCRIPTION\n virt-uname prints the uname information such as OS version,\n architecture and node name for virtual machines running under\n libvirt." msgstr "" diff --git a/po/virt-mem.pot b/po/virt-mem.pot index 7aabd15..67178a0 100644 --- a/po/virt-mem.pot +++ b/po/virt-mem.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-06-10 15:09+0000\n" +"POT-Creation-Date: 2008-06-10 16:27+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -73,6 +73,10 @@ msgstr "" msgid "NAME\n virt-dmesg - dmesg command for virtual machines\n\nSUMMARY\n virt-dmesg [-options] [domains]\n\nDESCRIPTION\n virt-dmesg prints the kernel messages for virtual machines running\n under libvirt. The output is similar to the ordinary dmesg command\n run inside the virtual machine." msgstr "" +#: ../ps/virt_ps.ml:26 +msgid "NAME\n virt-ps - process listing command for virtual machines\n\nSUMMARY\n virt-ps [-options] [domains]\n\nDESCRIPTION\n virt-ps prints a process listing for virtual machines running under\n libvirt." +msgstr "" + #: ../uname/virt_uname.ml:26 msgid "NAME\n virt-uname - uname command for virtual machines\n\nSUMMARY\n virt-uname [-options] [domains]\n\nDESCRIPTION\n virt-uname prints the uname information such as OS version,\n architecture and node name for virtual machines running under\n libvirt." msgstr "" diff --git a/ps/Makefile.in b/ps/Makefile.in new file mode 100644 index 0000000..b9de26b --- /dev/null +++ b/ps/Makefile.in @@ -0,0 +1,67 @@ +# virt-mem +# @configure_input@ +# Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +INSTALL = @INSTALL@ +MKDIR_P = @MKDIR_P@ +bindir = @bindir@ + +SYNTAX = -pp "camlp4o -I$$(ocamlc -where)/bitmatch bitmatch.cma pa_bitmatch.cmo" + +#OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitmatch +OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light -I +bitmatch -I ../lib + +ifneq ($(pkg_gettext),no) +OCAMLCPACKAGES += -package gettext-stub +endif + +OCAMLCFLAGS = @OCAMLCFLAGS@ $(SYNTAX) +OCAMLCLIBS = -linkpkg bitmatch.cma ../lib/virt_mem.cma + +OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ $(SYNTAX) +OCAMLOPTPACKAGES = $(OCAMLCPACKAGES) +OCAMLOPTLIBS = -linkpkg bitmatch.cmxa ../lib/virt_mem.cmxa + +OCAMLDOCFLAGS = -html -sort $(OCAMLCPACKAGES) $(SYNTAX) + +OCAMLDEPFLAGS = $(SYNTAX) + +TARGETS = virt-ps virt-ps.opt + +OBJS = virt_ps.cmo +XOBJS = virt_ps.cmx + +all: $(TARGETS) + +virt-ps: $(OBJS) ../lib/virt_mem.cma + ocamlfind ocamlc \ + $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $(OCAMLCLIBS) $(OBJS) -o $@ + +virt-ps.opt: $(XOBJS) ../lib/virt_mem.cmxa + ocamlfind ocamlopt \ + $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) $(XOBJS) -o $@ + +install: + if [ -x virt-ps.opt ]; then \ + $(MKDIR_P) $(DESTDIR)$(bindir); \ + $(INSTALL) -m 0755 virt-ps.opt $(DESTDIR)$(bindir)/virt-ps; \ + fi + +include ../Make.rules \ No newline at end of file diff --git a/ps/virt_ps.ml b/ps/virt_ps.ml new file mode 100644 index 0000000..94301ce --- /dev/null +++ b/ps/virt_ps.ml @@ -0,0 +1,36 @@ +(* Memory info for virtual domains. + (C) Copyright 2008 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. + *) + +open Printf + +open Virt_mem_gettext.Gettext +open Virt_mem_utils +open Virt_mem_mmap + +let usage = s_"NAME + virt-ps - process listing command for virtual machines + +SUMMARY + virt-ps [-options] [domains] + +DESCRIPTION + virt-ps prints a process listing for virtual machines running under + libvirt." + +let debug, images = Virt_mem.start usage diff --git a/virt-ps.1 b/virt-ps.1 new file mode 100644 index 0000000..29f29cc --- /dev/null +++ b/virt-ps.1 @@ -0,0 +1 @@ +.so man1/virt-mem.1 -- 1.8.3.1