bitmatch -> bitstring
[virt-mem.git] / dmesg / virt_dmesg.ml
index 10d231f..dd41d26 100644 (file)
@@ -23,22 +23,9 @@ open Virt_mem_gettext.Gettext
 open Virt_mem_utils
 open Virt_mem_mmap
 
-let usage = s_"NAME
-  virt-dmesg - dmesg command for virtual machines
-
-SUMMARY
-  virt-dmesg [-options] [domains]
-
-DESCRIPTION
-  virt-dmesg prints the kernel messages for virtual machines running
-  under libvirt.  The output is similar to the ordinary dmesg command
-  run inside the virtual machine."
-
-let verbose, images = Virt_mem.start usage
-
-let () =
+let run debug images =
   List.iter (
-    fun (name, arch, mem, lookup_ksym) ->
+    fun (_, name, arch, mem, lookup_ksym) ->
       try
        (* I don't know why but this symbol doesn't exist in 2.6.9
         * even in kallsyms.  Hence this won't work with that kernel.
@@ -86,3 +73,11 @@ let () =
          eprintf (f_"%s: could not find kernel log buffer in kernel image\n")
            name
   ) images
+
+let summary = s_"display kernel messages"
+let description = s_"\
+virt-dmesg prints the kernel messages for virtual machines running
+under libvirt.  The output is similar to the ordinary dmesg command
+run inside the virtual machine."
+
+let () = Virt_mem.register "dmesg" summary description ~run