Commit Graph

79 Commits

Author SHA1 Message Date
Richard W.M. Jones
4e687f687a recipes: Add sections about hexdumping, hexediting sectors.
(cherry picked from commit 5d9f10c312)
(cherry picked from commit 6ea7c08c99)
2012-11-22 13:07:05 +00:00
Richard W.M. Jones
f1a304055a recipes: Add recipe for diffing two guests.
(cherry picked from commit fd81d3f9b2)
(cherry picked from commit c8b3ea823e)
2012-11-22 13:07:01 +00:00
Richard W.M. Jones
6cb10eac0f guestfs-testing: Use L<> around links.
(cherry picked from commit dd09744432)
(cherry picked from commit 204d87098a)
2012-10-30 18:42:34 +00:00
Richard W.M. Jones
1b2a2d596c inspection: Fix calls to case_sensitive_path (RHBZ#858126).
Don't assume that if guestfs_case_sensitive_path returns NULL, that it
means the file does not exist.

The (previously undefined) behaviour of case_sensitive_path was that a
NULL return meant "either the file doesn't exist or some other error".
However in commit 973581780d this was
changed so that if the last element of the path didn't exist, it was
assumed to be a new file and the (non-NULL) path of the new file is
returned.

This change breaks code (including in libguestfs) which tries to use
case_sensitive_path as a dual-purpose call to fix-up a path for
Windows and test if the file exists.  Such code should be rewritten so
that it explicitly tests for file existence after calling
case_sensitive_path.

I examined all the calls to case_sensitive_path in libguestfs and
modified them where necessary.

Cherry picked from commit 9ea6e97014.
(cherry picked from commit ff610469fb)
2012-10-01 15:07:05 +01:00
Richard W.M. Jones
bb3415901c recipes: Add a section about diagnosing hanging guests.
(cherry picked from commit f7e138835a)
(cherry picked from commit f487298ed4)
2012-10-01 15:06:16 +01:00
Richard W.M. Jones
69dd49a814 guestfs-testing(1): Start by running libguestfs-test-tool.
(cherry picked from commit 9b7813c5bd)
(cherry picked from commit 7d674f2fbf)
2012-10-01 15:05:44 +01:00
Richard W.M. Jones
59be7551e5 recipes: Add section about uploading raw filesystem content.
(cherry picked from commit 8aa8eb205b)
(cherry picked from commit 53c4ec871d)
2012-10-01 15:02:53 +01:00
Richard W.M. Jones
ad4e8c4680 syntax: Remove trailing whitespace.
Found by 'make syntax-check'.
(cherry picked from commit 2cac8d490e)
2012-09-19 13:57:10 +01:00
Richard W.M. Jones
16c21e1c08 recipes: Checksum file/device. Download to stdout.
(cherry picked from commit b799bc58a8)
2012-09-19 13:42:17 +01:00
Richard W.M. Jones
6243fe1d5d 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.

(cherry picked from commit 2f97bf873b)
2012-08-30 22:39:42 +01:00
Richard W.M. Jones
c9436dcb0a 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.

(cherry picked from commit f1d98bbc79)
2012-08-30 22:14:11 +01:00
Richard W.M. Jones
fa760bbecf recipes: Update dumping filesystem content to mention that we now support MD/RAID.
(cherry picked from commit 52e38c7bdc)
2012-08-30 22:12:31 +01:00
Richard W.M. Jones
b0528b9659 recipes: Refer to virt-format, virt-make-fs for creating disk images.
(cherry picked from commit 1e4c6e36a6)
2012-08-30 22:12:11 +01:00
Richard W.M. Jones
ac0e0fa609 recipes: Cloning Windows: plans for virt-sysprep.
(cherry picked from commit 5f234548ed)
2012-08-30 22:11:43 +01:00
Richard W.M. Jones
97d146ded9 recipes: For auditing for setuid files, point to virt-ls examples.
(cherry picked from commit 9fd4d16819)
2012-08-30 22:11:37 +01:00
Richard W.M. Jones
dd6f3d7fba recipes: For sparsifying guests, point to virt-sparsify.
(cherry picked from commit 0d2e70b1c7)
2012-08-30 22:11:29 +01:00
Richard W.M. Jones
87648e3e51 recipes: For listing files, point to virt-ls.
(cherry picked from commit d944a491ac)
2012-08-30 22:10:52 +01:00
Richard W.M. Jones
eeaea356e2 recipes: Add a section on deleting a file and other common file operations.
(cherry picked from commit 10d48bef30)
2012-08-30 22:10:33 +01:00
Richard W.M. Jones
f92c331fc5 docs: Use L<...> for links.
Instead of working around bugs, podwrapper has been fixed so that
links work in all output formats.
(cherry picked from commit 4bc110e2bc)
2012-08-05 22:48:50 +01:00
Richard W.M. Jones
930433b194 build: Change calls to podwrapper.sh to use $(PODWRAPPER).
This will allow us to easily change the location of this
script in future.

(cherry picked from commit f2ea617e22)
2012-08-05 22:48:47 +01:00
Richard W.M. Jones
dff126b7c5 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

(cherry picked from commit ffbf1475f7)
2012-07-07 11:32:46 +01:00
Richard W.M. Jones
fe315f634c 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.
(cherry picked from commit 917550a117)
2012-07-07 11:26:41 +01:00
Richard W.M. Jones
62c149d735 examples: Add if HAVE_HIVEX ... endif around virt_dhcp_address example.
(cherry picked from commit 7201a48d18)
2012-05-14 15:48:58 +01:00
Richard W.M. Jones
db985c0485 Check return values of guestfs_inspect_get_{type,distro} (found by Coverity).
Error: NULL_RETURNS:
/builddir/build/BUILD/libguestfs-1.16.5/examples/virt-dhcp-address.c:129: var_assigned: Assigning: "guest_distro" = null return value from "guestfs_inspect_get_distro".
/builddir/build/BUILD/libguestfs-1.16.5/examples/virt-dhcp-address.c:131: dereference: Dereferencing a pointer that might be null "guest_distro" when calling "__coverity_strcmp".
[...]
/builddir/build/BUILD/libguestfs-1.16.5/examples/virt-dhcp-address.c:126: var_assigned: Assigning: "guest_type" = null return value from "guestfs_inspect_get_type".
/builddir/build/BUILD/libguestfs-1.16.5/examples/virt-dhcp-address.c:128: dereference: Dereferencing a pointer that might be null "guest_type" when calling "__coverity_strcmp".
(cherry picked from commit 618954a6b0)
2012-03-08 18:14:34 +00:00
Wanlong Gao
81b9aed9c3 examples: code cleanups
do a code cleanup by removing the tailing spaces

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
(cherry picked from commit 90d6386c13)
2012-02-02 10:22:58 +00:00
Richard W.M. Jones
08840bab44 Tempus fugit.
Update all copyright dates to 2012.
2012-01-18 22:05:02 +00:00
Richard W.M. Jones
7b3137e664 df, testing: Add notes on virt-df numbers (thanks Kashyap Chamarthy). 2011-11-22 13:21:17 +00:00
Richard W.M. Jones
6f39cfaeac guestfs-testing: Link to libguestfs-test-tool. 2011-11-21 13:09:59 +00:00
Richard W.M. Jones
a3b2429681 Add guestfs-testing(1) man page.
This contains suggested manual tests that users can run.
2011-11-20 13:39:28 +00: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
4baec012b1 out-of-tree build: remove unneeded explicit paths 2011-08-17 10:27:29 +01:00
Richard W.M. Jones
1fdd0193fd recipes: Remove two C file dependencies which are not actually used in the POD. 2011-08-15 14:55:10 +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
3819b657b0 recipes: in tr command \000 should be \0 2011-06-03 09:41:20 +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
9536892721 guestfs-examples(3): Remove link to OCaml homepage. 2011-05-18 17:02:53 +01:00
Richard W.M. Jones
34acb80a28 Enable deprecation warnings on all C programs. 2011-05-17 17:05:12 +01:00
Richard W.M. Jones
9e7c6a5483 New API: inspect-get-windows-current-control-set
This returns the actual registry key corresponding to
CurrentControlSet (eg. it might be "ControlSet001").

Previously the inspection code was hard-coding ControlSet001.  Now we
use the correct control set, and also make it available to callers
through the API.

This commit also updates the virt-dhcp-address example so it uses this
new API.

virt-inspector displays the current control set when available.
2011-04-05 20:01:15 +01:00
Richard W.M. Jones
97d737a88b examples: Add virt-dhcp-address program.
This is like the mythical 'virt-ifconfig'.  There is not enough
certainty around the right way to be doing this for us to make
a full virt tool for this.  Therefore the code is just an example.
2011-03-31 22:11:53 +01:00
Richard W.M. Jones
b41e73008a examples: Use WARN_CFLAGS, WERROR_CFLAGS macros instead of -Wall 2011-03-31 20:18:23 +01:00
Richard W.M. Jones
d5eb5216aa examples: size_t-correctness change in inspect_vm.c 2011-03-31 20:17:02 +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
58012dc9b6 docs: Standard C examples, and guestfs-examples(3) man page. 2010-11-24 20:12:11 +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
Jim Meyering
c372c7c23a maint: use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1 to exit
Convert all uses automatically, via these two commands:
git grep -l '\<exit *(1)' \
  | grep -vEf .x-sc_prohibit_magic_number_exit \
  | xargs --no-run-if-empty \
    perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/'
git grep -l '\<exit *(0)' \
  | grep -vEf .x-sc_prohibit_magic_number_exit \
  | xargs --no-run-if-empty \
  perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/'
* .x-sc_prohibit_magic_number_exit: New file.

Edit (RWMJ): Don't change Java code.
2009-11-20 12:14:14 +00:00