Commit Graph

19 Commits

Author SHA1 Message Date
Richard W.M. Jones
fcd75e021a generator: Remove unused parameter.
generate_c_call_args optional decl parameter is never actually
used, so remove it.
2010-10-20 13:35:43 +01:00
Richard W.M. Jones
6fbbcdd64c ocaml: Add g#ocaml_handle method. 2010-10-04 20:34:36 +01:00
Richard W.M. Jones
63bfcdbdd8 ocaml: Document g#close () method for objects. 2010-10-04 20:33:14 +01:00
Richard W.M. Jones
6af1cd7245 ocaml: Create the handle when the object is instantiated.
Previously we had only one handle shared between all objects .. oops.
This fixes commit 67636f7210.
2010-10-04 20:29:05 +01:00
Richard W.M. Jones
67636f7210 ocaml: Add alternate object-oriented programming style.
In original style:

let () =
  let filename = Sys.argv.(1) in
  let g = Guestfs.create () in
  Guestfs.add_drive_ro g filename;
  Guestfs.launch g;
  let roots = Guestfs.inspect_os g in
  print_endline (Guestfs.inspect_get_product_name g roots.(0))

The same code in the new OO style:

let () =
  let filename = Sys.argv.(1) in
  let g = new Guestfs.guestfs in
  g#add_drive_ro filename;
  g#launch ();
  let roots = g#inspect_os () in
  print_endline (g#inspect_get_product_name roots.(0))
2010-10-03 21:18:25 +01:00
Richard W.M. Jones
7e4bf29fdf New API: pread-device, partial read for devices. 2010-09-27 12:04:44 +01:00
Richard W.M. Jones
eeaab2ba84 New API: pwrite-device
This is the same as the existing 'pwrite' API call, but allows you
to write to a device.
2010-09-26 22:21:36 +01:00
Richard W.M. Jones
c9c0ac7d36 Allow $TMPDIR to override most temporary directory uses.
Be more consistent in allowing the user to override use of the
temporary directory by specifying $TMPDIR.  Also prefer P_tmpdir
macro (defined in <stdio.h>) if that is defined, rather than
hard-coding "/tmp" for the fallback location.
2010-09-24 19:25:06 +01:00
Richard W.M. Jones
d75a2bff12 fish: Implement 'hexedit' command. 2010-09-21 19:51:22 +01:00
Richard W.M. Jones
5d4ae18e2b New APIs: upload-offset and download-offset
These APIs allow you to efficiently write and read parts of
files or devices.
2010-09-21 19:51:22 +01:00
Richard W.M. Jones
0003ea2c3d generator: Generate guestfish-only commands.
The guestfish-only commands such as 'alloc' and 'edit' are
now generated from one place in the generator instead of being
spread around ad-hoc in the C code.
2010-09-18 09:38:05 +01:00
Richard W.M. Jones
585fceb335 fish: In guestfish(1) turn command references into links. 2010-09-18 09:11:31 +01:00
Richard Jones
000c4a82fb New API: list-filesystems: list filesystems
This API is a simpler replacement for the guestfish commands
list-devices / list-partitions / lvs, in the case where you are
just examining a guest by hand to see what it contains.

Typical usage and output in guestfish is like this:

$ guestfish --ro -a /dev/vg_trick/F13x64
><fs> run
><fs> list-filesystems
/dev/vda1: ext4
/dev/vg_f13x64/lv_root: ext4
/dev/vg_f13x64/lv_swap: swap

It can also be used to replace programs that try to mount
devices to determine if they are mountable filesystems.
2010-09-15 19:42:23 +01:00
Richard Jones
ffd4820ffe New API: part-to-dev: Convert partition name to device name.
This adds a formal API for going from a partition to the containing
device, eg. /dev/sda1 -> /dev/sda
2010-09-15 17:16:51 +01:00
Richard Jones
ff38fea645 generator: Add TestOutputDevice.
This is for testing functions that return a device or partition
name, so that we can compare the return value with the canonical
device name (eg. "/dev/vda1" == "/dev/sda1").
2010-09-15 17:16:51 +01:00
Richard Jones
67fd3a7d99 generator: Provide no-op generator if no OCaml compiler. 2010-09-11 13:42:00 +01:00
Richard Jones
b42262c3db generator: Calculate MD5 of test.iso at runtime.
Because this used to be compiled into the C test, it changed
every time the ISO was rebuilt (which because of Makefile deps
was every run).

Now it is calculated at runtime so the C test file doesn't keep
changing.
2010-09-11 12:44:55 +01:00
Richard Jones
451a28349b generator: Don't use real uuidgen for UUIDs.
This was one reason why capitests/tests.c changed every time the
generator was run.
2010-09-11 12:44:52 +01:00
Richard Jones
04d8209077 Split generator into separate source files.
'src/generator.ml' is no more.  Instead the generator is logically
split up over many different source files.

Read generator/README for help and tips.

We compile the generator down to bytecode, not native code.  This
means it will run more slowly, but is done for maximum portability.
2010-09-11 12:04:44 +01:00