Add outline of 'virt-ps' command.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 10 Jun 2008 16:28:24 +0000 (17:28 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 10 Jun 2008 16:28:24 +0000 (17:28 +0100)
12 files changed:
.hgignore
MANIFEST
Makefile.in
configure.ac
po/POTFILES
po/ja.po
po/pl.po
po/pt_BR.po
po/virt-mem.pot
ps/Makefile.in [new file with mode: 0644]
ps/virt_ps.ml [new file with mode: 0644]
virt-ps.1 [new file with mode: 0644]

index a3a9b9b..771c749 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -26,4 +26,5 @@ po/*.po.bak
 po/*.po.orig
 uname/virt-uname
 dmesg/virt-dmesg
 po/*.po.orig
 uname/virt-uname
 dmesg/virt-dmesg
+ps/virt-ps
 samples
\ No newline at end of file
 samples
\ No newline at end of file
index 3102f6e..1f8fcfe 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -25,6 +25,9 @@ po/virt-mem.pot
 po/ja.po
 po/pl.po
 po/pt_BR.po
 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
 README
 uname/.depend
 uname/Makefile.in
@@ -33,4 +36,5 @@ virt-dmesg.1
 virt-mem.1
 virt-mem.pod
 virt-mem.txt
 virt-mem.1
 virt-mem.pod
 virt-mem.txt
+virt-ps.1
 virt-uname.1
\ No newline at end of file
 virt-uname.1
\ No newline at end of file
index a2026de..8ccb0ef 100644 (file)
@@ -26,7 +26,7 @@ mandir                = @mandir@
 
 HAVE_PERLDOC    = @HAVE_PERLDOC@
 
 
 HAVE_PERLDOC    = @HAVE_PERLDOC@
 
-TOOLS          = uname dmesg
+TOOLS          = uname dmesg ps
 
 ifeq ($(HAVE_PERLDOC),perldoc)
 MANPAGES        = virt-mem.1 $(TOOLS:%=virt-%.1)
 
 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
        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
 
 distclean: clean
        rm -f config.h config.log config.status configure
index b281e5e..53287c4 100644 (file)
@@ -139,6 +139,7 @@ AC_CONFIG_FILES([Makefile
        lib/virt_mem_version.ml
        uname/Makefile
        dmesg/Makefile
        lib/virt_mem_version.ml
        uname/Makefile
        dmesg/Makefile
+       ps/Makefile
        po/Makefile
        ])
 AC_OUTPUT
        po/Makefile
        ])
 AC_OUTPUT
index 531f88f..f2d7487 100644 (file)
@@ -1,5 +1,6 @@
 ../dmesg/virt_dmesg.ml
 ../uname/virt_uname.ml
 ../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
 ../lib/virt_mem_utils.ml
 ../lib/virt_mem_gettext.ml
 ../lib/virt_mem_version.ml
index 2bd2935..49394b0 100644 (file)
--- 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 ""
 
 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 ""
 #: ../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 ""
index 6fc8abe..5d9cb97 100644 (file)
--- 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 ""
 
 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 ""
 #: ../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 ""
index c7c0e78..493cef3 100644 (file)
@@ -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 ""
 
 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 ""
 #: ../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 ""
index 7aabd15..67178a0 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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"
@@ -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 ""
 
 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 ""
 #: ../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 (file)
index 0000000..b9de26b
--- /dev/null
@@ -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 (file)
index 0000000..94301ce
--- /dev/null
@@ -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 (file)
index 0000000..29f29cc
--- /dev/null
+++ b/virt-ps.1
@@ -0,0 +1 @@
+.so man1/virt-mem.1