Commit Graph

50 Commits

Author SHA1 Message Date
Richard W.M. Jones
f30b2065a2 gobject: Add outline guestfs-gobject(3) manual page.
Since we removed gtk doc, we might as well replace it with a
manual page explaining the basics of how to run gjs.
2017-07-10 17:03:19 +01:00
Richard W.M. Jones
f161c9ea57 Rename src/ to lib/ 2017-01-26 15:05:46 +00:00
Pino Toscano
55bf7de97c Update copyright dates for 2017
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2016/$1-2017/g' `git ls-files`

(Thanks Rich for the perl snippet, as used in past years.)
2017-01-03 16:48:21 +01:00
Richard W.M. Jones
76c0a67d30 build: Add common CLEANFILES and DISTCLEANFILES to common-rules.mk.
By adding common CLEANFILES and DISTCLEANFILES variables to
common-rules.mk, we can remove these from most other Makefiles, and
also clean files more consistently.

Note that bin_PROGRAMS are already cleaned by 'make clean', so I
removed cases where these were unnecessarily added to CLEANFILES.
2016-08-25 16:54:34 +01:00
Richard W.M. Jones
307c83177c Update copyright dates for 2016.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2015/$1-2016/g' `git ls-files`
2016-01-02 21:19:51 +00:00
Richard W.M. Jones
a2edda266e build: Make 'make clean' remove more files.
Remove man pages and other pages which 'make clean' did not remove
before.

To evaluate which pages could be removed, I did a full build and
check, and then ran 'make clean' followed by 'git clean -xdf'.  By
examining the output of the git clean command I could see which files
were being missed.

Files that are _not_ removed by make clean or make distclean:

 - generator-built files

 - Makefile, Makefile.in, .deps, .depend

 - any ./configure output files (maybe they should be?)
2015-11-03 13:53:37 +00:00
Richard W.M. Jones
47b095b928 website: Put website into a separate directory.
Move the random set of HTML files we build from html/ into
the website/ directory.

Also in the website/ directory, put the index.html file from
http://libguestfs.org, which was previously not under version control.
It is generated from index.html.in so we can automatically add the
current version and release date.

Also in the website/ directory, put various CSS file, images, etc.
which are required by the website and were also previously not under
version control.

Change the 'make website' rule to 'make maintainer-upload-website'.
As the name suggests, it is only useful for the maintainer, and will
fail with an error for anyone else.
2015-10-31 17:09:29 +00:00
Richard W.M. Jones
b1f11ef75b ocaml/examples: Fix use of event_callback in debug_logging.ml.
This fixes commit 8bbc5e73cb.
2015-10-07 14:16:00 +01:00
Richard W.M. Jones
a332e23dde ocaml/examples: Remove all programs in 'make clean'.
Previously the debug_logging program was not being deleted.
2015-10-07 14:15:05 +01:00
Richard W.M. Jones
c5800dc97d Update copyright dates for 2015. 2015-01-17 09:08:15 +00:00
Richard W.M. Jones
378ed3be5e ocaml: Convert debug_logging example from C to OCaml.
Continue gradual conversion of C examples to other languages.
2015-01-17 07:14:33 +00:00
Richard W.M. Jones
c4dc70f8c4 podwrapper: Remove =encoding from input files and add it back in podwrapper.
This changes podwrapper so that the input (POD) files should not
contain an =encoding directive.  However they must be UTF-8.
Podwrapper then adds the '=encoding utf8' directive back during final
generation.

This in particular avoids problems with nested =encoding directives in
fragments.  These break POD, and are undesirable anyway.
2014-03-20 13:47:19 +00:00
Hilko Bengen
876983365a More fixes for situations where ocamlopt is not available
- run bindtests.opt only if available
- use ocamlc -custom
- Don't try to install native code if it hasn't been built (Thanks to Olaf Hering)
2014-03-04 00:06:07 +01:00
Hilko Bengen
f75142c577 Fix building on architectures where ocamlopt is not available 2014-02-28 14:01:25 +00:00
Richard W.M. Jones
d60e6a23a6 examples: Update various examples to use new disk-create API. 2014-01-28 21:02:11 +00:00
Richard W.M. Jones
06f2c1ad70 golang: Add examples and guestfs-golang(3) man page. 2013-07-04 15:48:47 +01:00
Richard W.M. Jones
49bdaabc7d build: Add common-rules.mk, common rules for all Makefiles.
This file is mainly a central place to:

 - include localenv if it exists, and

 - define the RHEL 5 backwards compatibility macros, instead of
   spreading them over every other file.
2013-06-04 12:41:11 +01:00
Richard W.M. Jones
5c513060b1 ocaml: Add binding for Guestfs.event_to_string and use it in events test. 2013-02-19 13:41:57 +00:00
Richard W.M. Jones
ff8bfd3e92 Add Lua bindings.
These are relatively complete, although only lightly tested.  Missing:

 - events
 - last_errno
 - user_cancel
2012-11-17 20:02:42 +00:00
Richard W.M. Jones
2f97bf873b podwrapper: Add --license parameter, which is required.
This adds standard LICENSE and BUGS sections to all of the man pages
that are processed by podwrapper.

Modify all the calls to $(PODWRAPPER) to add the right --license
parameter according to the content.  Note that this relaxes the
license on some code example pages, making them effectively BSD-style
licensed.
2012-08-21 20:33:21 +01:00
Richard W.M. Jones
f1d98bbc79 man pages: Ensure consistent copyright/author sections, remove license
section.

Ensure each man page contains consistent COPYRIGHT and AUTHOR
sections.

Remove the LICENSE section.  We will add that back in podwrapper in a
later commit.
2012-08-21 20:16:29 +01:00
Richard W.M. Jones
d67e6ea75d Replace mount-options with mount where appropriate.
Since our minimum supported version is now 1.16 and mount was fixed in
1.13.16, it is now safe to replace mount-options + empty options with
mount wherever it occurs.
2012-08-18 22:08:29 +01:00
Richard W.M. Jones
863168467f examples: Use add_drive_opts function in examples.
In libguestfs 1.20, you will be able to use 'add_drive'
instead of 'add_drive_opts' (except in the C bindings).

However until libguestfs 1.20 is the minimum stable version
people will still be using old versions where you have to use
'add_drive_opts'.  This makes the examples confusing.

Therefore continue to use 'add_drive_opts' in the examples
for now.
2012-08-02 17:21:47 +01:00
Richard W.M. Jones
f2ea617e22 build: Change calls to podwrapper.sh to use $(PODWRAPPER).
This will allow us to easily change the location of this
script in future.
2012-07-16 18:56:57 +01:00
Richard W.M. Jones
7486fc6f43 generator: Rename 'add_drive_opts' API to 'add_drive'.
By using the once_had_no_optargs flag, this change is backwards
compatible for callers (except Haskell, PHP and GObject as discussed
in earlier commit).
2012-07-14 12:42:24 +01:00
Richard W.M. Jones
ffbf1475f7 New API: guestfs_shutdown: Cleanly shutdown the backend.
The new API splits orderly close into a two-step process:

  if (guestfs_shutdown (g) == -1) {
    /* handle the error, eg. qemu error */
  }
  guestfs_close (g);

Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors.  Read the documentation for further information.

This change also:

 - deprecates guestfs_kill_subprocess

 - turns guestfs_kill_subprocess into the same as guestfs_shutdown

 - changes guestfish and other tools to call shutdown + close
   where necessary (not for read-only tools)

 - updates documentation

 - updates examples
2012-07-03 21:27:29 +01:00
Richard W.M. Jones
917550a117 examples: In create_disk example, don't call set_autosync.
This is now set by default in all supported versions of libguestfs.
It's just confusing if the examples refer to it.
2012-07-03 14:45:42 +01:00
Jim Meyering
e97b6a1bb1 maint: fix doc typos
Fix typos spotted by http://github.com/lyda/misspell-check.
* configure.ac: As above.
* ocaml/examples/guestfs-ocaml.pod: Likewise.
* fish/guestfish.pod: Likewise.
2012-04-18 20:04:38 +01:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Richard W.M. Jones
84763d7fca Add Erlang bindings. 2011-09-21 15:21:58 +01:00
Hilko Bengen
ff101adf7e out-of-tree build: fix documentation generation 2011-08-15 14:50:33 +01:00
Richard W.M. Jones
d025e91f67 java: Add guestfs-java(3) man page. 2011-07-19 17:54:35 +01:00
Richard W.M. Jones
f2c7df589c Add new guestfs-rescue(1) man page with recipes. 2011-05-18 21:03:44 +01:00
Richard W.M. Jones
477eebc83d perl: Translate C examples into Perl and include a manual page. 2011-01-30 23:41:05 +00:00
Richard W.M. Jones
0c60e4d9dd fish: Don't fail if some mountpoints in /etc/fstab are bogus (RHBZ#668574).
Fix guestfish (and other C tools) so that they ignore errors
when /etc/fstab contains bogus entries.

Update the documentation for inspect-get-mountpoints to emphasize
that callers must be aware of this when mounting the returned
values.

Add a regression test.

Update the example code ("inspect_vm") to reflect the way this
API ought to be called.

For more detail see:
https://bugzilla.redhat.com/show_bug.cgi?id=668574
2011-01-11 11:09:41 +00:00
Richard W.M. Jones
37e632b7b8 ruby: Translate C examples into Ruby and include documentation. 2010-11-24 20:13:13 +00:00
Richard W.M. Jones
472722a72d python: Translate C examples into Python and include documentation. 2010-11-24 20:12:50 +00:00
Richard W.M. Jones
086bd1f7bf ocaml: Translate C examples into OCaml and include documentation. 2010-11-24 20:12:16 +00:00
Richard W.M. Jones
53c5248193 ocaml: Remove the old OCaml viewer program.
This program is obsolete and the code has been reused for
guestfs-browser here:
http://people.redhat.com/~rjones/guestfs-browser/
2010-11-08 14:28:44 +00:00
Richard W.M. Jones
14490c3e1a generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).
This large commit changes the generator so that optional arguments
can be supported for functions.

The model for arguments (known as the "style") is changed from
(ret, args) to (ret, args, optargs) where optargs is a more limited
list of arguments.

One function has been added which takes optional arguments, it is
"add-drive-opts", modelled as:

  (RErr, [String "filename"], #required
         [Bool "readonly"; String "format"; String "iface"]) #optional

Note that this function is processed in the library (does not go over
the RPC protocol to the daemon).  This has allowed us to simplify
the current implementation by omitting changes related to RPC or the
daemon, although we plan to add these at some point in the future.

From C this function can be called in 3 different ways as in these
examples:

  guestfs_add_drive_opts (g, filename,
                          GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,
			  GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
                          -1);

(the argument(s) between 'filename' and '-1' are the optional ones).

  guestfs_add_drive_opts_va (g, filename, args);

where 'args' is a va_list.  This works like the first version.

  struct guestfs_add_drive_opts_argv optargs = {
    .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK,
    .readonly = 1,
  }
  guestfs_add_drive_opts_argv (g, filename, &optargs);

This last form lets you construct lists of optional arguments, and
is used by guestfish and the language bindings.

In guestfish optional arguments are used like this:

  add-drive-opts filename readonly:true

In OCaml these are mapped naturally to OCaml optional arguments, eg:

  g#add_drive_opts ~readonly:true filename;

In Perl these are mapped to extra arguments, eg:

  $g->add_drive_opts ($filename, readonly => 1);

In Python these are mapped to optional arguments, eg:

  g.add_drive_opts ("file", readonly = 1, format = "qcow2")

In Ruby these are mapped to a final hash argument, eg:

  g.add_drive_opts("file", {})
  g.add_drive_opts("file", :readonly => 1)
  g.add_drive_opts("file", :readonly => 1, :iface => "virtio")

In PHP these are mapped to extra parameters.  This is not quite
accurate since you cannot omit arbitrary optional parameters, but
there's not much than can be done within the limitations of PHP
as a language.

Unimplemented in: Haskell, C#, Java.
2010-10-22 17:45:00 +01:00
Richard Jones
82bd4fac87 ocaml examples: Fix linking line so it uses local library. 2010-03-22 10:41:46 +00:00
Richard Jones
de64183f3d Tab to space fixes, now passes 'make syntax-check' 2009-10-20 15:03:16 +01:00
Richard Jones
f57f338c3b Add some missing EXTRA_DIST files. 2009-10-14 11:24:33 +01:00
Jim Meyering
dde81c0c0e build: fix compile error
Link demo scripts with just-build library, not the installed one.
* ocaml/examples/Makefile.am (OCAMLFINDFLAGS): New variable.
(lvs, viewer): Use it.
This fix is based on a suggestion from Rich Jones.
This addresses RHBZ#526917.
2009-10-02 16:15:12 +02:00
Richard Jones
d525103c86 OCaml viewer: Use ocamlduce to replace xpath code. 2009-09-30 16:14:35 +01:00
Richard Jones
d278ef8ad9 OCaml viewer: Handle exceptions properly. 2009-09-29 11:56:26 +01:00
Richard Jones
4c8bdd3424 OCaml example: graphical disk usage viewer.
This is an example of how to write an app which uses libguestfs
and libvirt, and has a responsive user interface (using threads).
It is a Gtk-based "graphical virt-df".

Read the top of the 'viewer.ml' file first for instructions on
how to compile.  This program is not compiled by default.
2009-09-29 11:05:26 +01:00
Richard Jones
8869adf1e8 Remove guestfs_wait_ready (turn it into a no-op).
This commit changes guestfs_launch so that it both launches
the appliance and waits until it is ready (ie. the daemon communicates
back to us).

Since we removed the pretence that we could implement a low-level
asynchronous API, the need to call launch() followed by wait_ready()
has looked a bit silly.

Now guestfs_wait_ready() is basically a no-op.  It is left in the
API for backwards compatibility.  Any calls to guestfs_wait_ready()
can be removed from client code.
2009-09-21 12:01:51 +01:00
Jim Meyering
41b959fd9b build: don't tell "make clean" to remove my '~' backup files
Hi Rich,

automake's policy on what to remove via "make clean" is reasonable:
if running build rules creates it, then "make clean" can and should remove it.
However, even if build rules happen
to create backup files, please remove only the specific ones
they can create, not all of the ones in a directory.  Just in case
someone relies on those and expect them to hang around...

>From 1e8be391ac17b4ddcf9671e8413d2660844e6993 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 30 Apr 2009 15:47:52 +0200
Subject: [PATCH] build: don't tell "make clean" to remove my '~' backup files

* Makefile.am (CLEANFILES): Don't remove '~' backup files.
* daemon/Makefile.am: Ditto.
* examples/Makefile.am: Ditto.
* fish/Makefile.am: Ditto.
* images/Makefile.am: Ditto.
* inspector/Makefile.am: Ditto.
* java/Makefile.am: Ditto.
* ocaml/Makefile.am: Ditto.
* ocaml/examples/Makefile.am: Ditto.
* perl/Makefile.am: Ditto.
* python/Makefile.am: Ditto.
* ruby/Makefile.am: Ditto.
* src/Makefile.am: Ditto.
2009-04-30 16:13:06 +01:00
Richard Jones
bf26360e5e Added OCaml examples. 2009-04-08 23:06:51 +01:00