Get rid of lookup_ksym function, replace with a map.
[virt-mem.git] / lib / virt_mem.ml
index 03b0d1e..9280a69 100644 (file)
@@ -350,22 +350,21 @@ Use 'virt-mem --help' for more help or read the manual page virt-mem(1)");
 
       List.map (
        fun (dom, _) ->
-         let id = D.get_id dom in
-         let name = D.get_name dom in
+         let domname = D.get_name dom in
 
          let wordsize =
            match !def_wordsize with
            | None ->
                failwith
                  (sprintf (f_"%s: use -W to define word size for this image")
-                    name);
+                    domname);
            | Some ws -> ws in
          let endian =
            match !def_endian with
            | None ->
                failwith
                  (sprintf (f_"%s: use -E to define endianness for this image")
-                    name);
+                    domname);
            | Some e -> e in
 
          let arch =
@@ -373,11 +372,11 @@ Use 'virt-mem --help' for more help or read the manual page virt-mem(1)");
            | Some I386 -> I386 | Some X86_64 -> X86_64
            | _ ->
                failwith
-                 (sprintf (f_"%s: use -A to define architecture (i386/x86-64 only) for this image") name) in
+                 (sprintf (f_"%s: use -A to define architecture (i386/x86-64 only) for this image") domname) in
 
          if !def_text_addr = 0L then
            failwith
-             (sprintf (f_"%s: use -T to define kernel load address for this image") name);
+             (sprintf (f_"%s: use -T to define kernel load address for this image") domname);
 
          let start_t = gettimeofday () in
 
@@ -409,7 +408,7 @@ Use 'virt-mem --help' for more help or read the manual page virt-mem(1)");
          let mem = Virt_mem_mmap.set_wordsize mem wordsize in
          let mem = Virt_mem_mmap.set_endian mem endian in
 
-         ((Some id, name, arch, mem) : image0)
+         { dom = Some dom; domname = domname; mem = mem; arch = arch }
       ) xmls
     ) else (
       (* One or more -t options passed. *)
@@ -457,7 +456,7 @@ Use 'virt-mem --help' for more help or read the manual page virt-mem(1)");
          let mem = Virt_mem_mmap.set_wordsize mem wordsize in
          let mem = Virt_mem_mmap.set_endian mem endian in
 
-         ((None, filename, arch, mem) : image0)
+         { dom = None; domname = filename; mem = mem; arch = arch }
       ) testimages
     ) in
 
@@ -483,6 +482,7 @@ Use 'virt-mem --help' for more help or read the manual page virt-mem(1)");
        (* Look for kallsyms: *)
        let image = Virt_mem_kallsyms.find_kallsyms debug image in
 
+(*
        (* Finally, just wrap the lookup_ksym call in something
         * which prints the query when debug is set.
         *)
@@ -501,6 +501,7 @@ Use 'virt-mem --help' for more help or read the manual page virt-mem(1)");
            (domid, name, arch, mem, lookup_ksym)
          else
            image in
+*)
 
        image
     ) images in