Commit Graph

62 Commits

Author SHA1 Message Date
Richard W.M. Jones
b7d622dbbf resize: Depend explicitly on Unix module.
Commit a0722c7ad8 introduced a
dependency on the Unix module.  This was not listed in the list of
'-package's, but as long as you had ocaml-gettext installed it would
still work because that pulled in Unix implicitly.

Thanks Olaf Hering.
(cherry picked from commit a66fd2fac2)
2012-10-30 17:14:24 +00:00
Richard W.M. Jones
f90b5bdff7 resize, sparsify: Suppress progress bar when output is not a tty.
(cherry picked from commit a0722c7ad8)
2012-10-30 17:14:24 +00:00
Richard W.M. Jones
07b409ff9a sparsify: Re-use progress bar wrapper code from virt-resize.
The code was identical -- just copied with s/resize/sparsify/.
Instead of duplicating identical code, cause the Makefile.am to use
the code from the ../resize/ directory.

Unfortunately because there are two Utils modules (which are
different), this means we had to rename those modules to Resize_utils
and Sparsify_utils respectively.  So this is a rather larger change
than intended.  However it's just code motion.

(cherry picked from commit 91b2238fc8)
2012-10-30 17:14:23 +00:00
Richard W.M. Jones
d37ccaacb3 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:04:55 +01:00
Richard W.M. Jones
ebf3342f5a 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:04:55 +01:00
Richard W.M. Jones
44ff06671a build: Rename most C files that contain underscore with dash.
This is just code motion.

Some files cannot be renamed.  Notably rpcgen input and output files
must not contain dash characters, else rpcgen breaks.

Cherry picked from commit 2e4089f300
and modified so that conflicts in the following files:
	po-docs/ja.po
	po-docs/libguestfs-docs.pot
	po-docs/uk.po
were resolved by simply copying the files from the master branch.
2012-08-05 21:32:12 +01:00
Richard W.M. Jones
7634bae8e5 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 21:12:22 +01:00
Richard W.M. Jones
a659f2c316 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-06 17:36:30 +01:00
Richard W.M. Jones
56e77e9ca0 test-virt-resize: Replace truncate with guestfish sparse.
Another instance of 'truncate' command.

See commit 39df80dcc0 for an
explanation.
(cherry picked from commit ef1514aa1e)
2012-06-28 09:09:37 +01:00
Richard W.M. Jones
13d1da17d4 build: Define builddir and abs_srcdir when they are missing.
RHEL 5-era autoconf did not define these, so define them manually
when they are missing.

Define builddir as '.'  The scripts require this.  It won't work
in the srcdir != builddir case, but we don't care about that for
RHEL 5.

This commit also moves the builddir / abs_srcdir variable setting
above the include of subdir-rules.mk, in case that include uses
these variables.

Useful script:

  for f in $(find -name Makefile.am | xargs fgrep '$(abs_srcdir)' -l) ; do
    if ! grep -q '^abs_srcdir' $f; then
      echo missing in $f
    fi
  done
(cherry picked from commit 50aa9533e4)
2012-06-21 12:51:45 +01:00
Richard W.M. Jones
a41a5a6fef ocaml: Use OCAMLOPTFLAGS when compiling .cmx (ie. native code) files.
(cherry picked from commit dd216fedbd)
2012-06-21 12:51:21 +01:00
Richard W.M. Jones
2fd2c85f6a doc: Add notes on how GPT works on 4k sector disks.
I used scsi_debug to create a 4k sector virtual disk:

  modprobe scsi_debug dev_size_mb=128 sector_size=4096

I then used 'gdisk' to create lots of partitions, and used 'hexdump'
to examine what was written to disk.
2012-05-14 17:47:57 +01:00
Richard W.M. Jones
027fefd517 Add gettext support for OCaml tools (virt-resize, virt-sparsify, virt-sysprep).
Note that this support is optional: To enable it, install the
ocaml-gettext library from
http://forge.ocamlcore.org/projects/ocaml-gettext .  If this library
is not installed, then configure detects this and inserts dummy
gettext functions that do nothing.
2012-05-01 09:39:35 +01:00
Richard W.M. Jones
84d450210b resize, sparsify: Add a simple-minded check to stop indisk = outdisk. 2012-04-17 15:03:02 +01:00
Richard W.M. Jones
6e3de76278 Ensure that SOURCES are always in EXTRA_DIST, even if OCaml not available. 2012-03-31 23:17:41 +01:00
Richard W.M. Jones
2fb545b840 resize2fs: Run 'e2fsck -f' automatically if filesystem is not mounted. 2012-03-09 18:05:31 +00:00
Richard W.M. Jones
88ba4da4d6 resize: Fix --output-format flag (RHBZ#798196).
Update the test to use the --format and --output-format flags.
2012-02-28 10:30:57 +00:00
Richard W.M. Jones
a93d4a9dc1 resize: Document steps to avoid UNMOUNTABLE_BOOT_VOLUME BSOD (RHBZ#797986).
(Thanks Grant Williamson for finding and fixing this problem)
2012-02-27 19:39:43 +00:00
Hilko Bengen
b7122eaa58 resize, sparsify: find progress mini-library in out-of-tree builds (2) 2012-01-23 23:17:37 +01:00
Hilko Bengen
b6e0552ee5 Do not run appliance-related checks if not building appliance 2012-01-23 09:08:33 +00:00
Hilko Bengen
7004fafc69 Replace setting of environment variables with usage of local run script
(Includes fix by RWMJ)
2012-01-23 09:08:21 +00:00
Hilko Bengen
b8720abfe5 resize, sparsify: find progress mini-library in out-of-tree builds 2012-01-20 16:10:14 +00:00
Hilko Bengen
251c6e994d Fixed out-of-tree compilation of OCaml code after .depend files removal 2012-01-20 16:10:14 +00:00
Richard W.M. Jones
08840bab44 Tempus fugit.
Update all copyright dates to 2012.
2012-01-18 22:05:02 +00:00
Matthew Booth
f6db1ec410 build: Remove .depend files from git
Remove generated .depend files from source control, and don't barf when they
don't exist while bootstrapping.
2012-01-11 16:00:00 +00:00
Matthew Booth
c655415dc0 build: Fix automake warnings 2012-01-04 10:38:44 +00:00
Richard W.M. Jones
7708d3e04f extra tests: Test virt-resize.
This adds the virt-resize --debug-gc option which causes
virt-resize to call Gc.compact before exiting, allowing
GC and memory problems to be tested.

Add an extratest which runs virt-resize under valgrind.
2011-11-29 17:14:18 +00:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Richard W.M. Jones
ffbafadcb8 resize: Remove requirement for ocaml Pcre library.
This library is not available in RHEL 6, and in any case removing the
dependency is a simple change.
2011-11-03 10:46:50 +00:00
Richard W.M. Jones
6389826810 resize: Add tests for some Utils functions. 2011-11-03 10:32:02 +00:00
Richard W.M. Jones
d64fca7b84 virt-resize: Be much more conservative about moving first partition.
Commit 2910413850 caused Windows 7
resizes to break with the 0xc0000225 boot error.

Change the --align-first auto (default) option so that it is more
conservative about when it moves the first partition.  In particular
it doesn't move it if it's already aligned (as it is for Win7), nor if
there is more than one partition (also Win7).

Tested with: Windows XP, 2003, 7, Ubuntu 10.10 and RHEL 5.
2011-10-26 13:56:18 +01:00
Richard W.M. Jones
119e67a92e virt-resize: Handle extended and logical partitions (RHBZ#642821). 2011-10-26 10:07:26 +01:00
Richard W.M. Jones
f4b3351692 resize: Get the partition table type of the source disk earlier.
Also we only permit MBR (DOS) and GPT partition tables.  In theory
previously we allowed other partition table types, but it is unlikely
that it would have worked in reality.
2011-10-26 10:07:26 +01:00
Richard W.M. Jones
663b99950d ocaml: Make sure virt-resize, virt-sparsify are rebuilt if Guestfs API changes.
Add a dependency so these tools are rebuilt from scratch if the
Guestfs API changes.  This prevents the error:
"[...] make inconsistent assumptions over interface Guestfs".

This commit includes the generated changes to .depend files.
2011-10-25 14:16:47 +01:00
Richard W.M. Jones
2910413850 resize: Add --align-first auto|never|always option.
The first partition can now be aligned.  We fix the bootloader
correctly for Windows by adjusting the "Hidden Sectors" field.
2011-10-20 23:16:44 +01:00
Richard W.M. Jones
37cdd39ada resize: Add --alignment flag to allow partition alignment to be picked. 2011-10-20 16:49:15 +01:00
Richard W.M. Jones
5d8e4102b4 resize: Refactor the code for creating target partitions.
The old code mixed the business of planning the layout of the target
partitions with the creation of the target partitions.  The
replacement code separates these into two tasks: firstly we create a
new 'partitions' list with the target layout, secondly this directly
drives the creation of the partitions.

As part of this change I have *removed* the old code that was supposed
to handle extended/logical MBR partitions.  It simply didn't work, and
didn't have any hope of working, and there is a separate bug open to
fix it.
2011-10-20 16:48:30 +01:00
Richard W.M. Jones
9f19895604 resize: Remove p_size field from partitions structure.
This field simply contained a duplicate copy of p_part.part_size.

There is no functional change in this commit.
2011-10-20 14:53:13 +01:00
Richard W.M. Jones
74e4e86309 virt-resize: Align partitions to multiple of 128 sectors (instead of 64).
This gives us effectively 64 KByte alignment, optimal for all current
types of storage.
2011-10-06 10:22:16 +01:00
Richard W.M. Jones
fac15924f5 New tool: virt-sparsify to make disk images sparse. 2011-10-04 17:37:48 +01:00
Richard Jones
cbef2ffb04 Stable OCaml dependencies. 2011-09-12 11:33:19 +01:00
Richard W.M. Jones
f0f3e16211 man pages: Add a standard EXIT STATUS section to most pages. 2011-08-27 17:47:10 +01:00
Richard W.M. Jones
09a7545649 resize: Add --machine-readable option for machine friendly output. 2011-08-26 22:34:49 +01:00
Richard W.M. Jones
2faef37957 resize: Use guestfish progress bar mini-library.
There are two benefits:

 - the progress bars look better
 - there is a reasonably accurate estimate of how long each operation
   will take
2011-08-26 21:55:04 +01:00
Hilko Bengen
ff101adf7e out-of-tree build: fix documentation generation 2011-08-15 14:50:33 +01:00
Richard W.M. Jones
f7d18c84dd build: Set TMPDIR for local testing.
This avoids conflicts with the globally installed libguestfs
appliance, or lets us build in multiple local directories at the same
time without conflicts.
2011-08-08 12:41:54 +01:00
Richard W.M. Jones
62a34ff2d3 resize: Clarify examples in the man page. 2011-07-14 13:42:33 +01:00
Richard W.M. Jones
f2d816573f resize: Add btrfs support to virt-resize (RHBZ#721275). 2011-07-14 13:03:49 +01:00
Richard W.M. Jones
08910ee60c docs: resize: Not just limited to resizing filesystems in partitions.
If you use --LV-expand then filesystems in LVs can be resized too.
2011-07-14 13:03:49 +01:00
Richard W.M. Jones
d84db26a2b virt-resize: Arrange options in man page in alphabetical order. 2011-07-13 09:44:13 +01:00