57 Commits

Author SHA1 Message Date
Richard W.M. Jones
72cfaff5c5 Update copyright dates for 2025
Automated using this command:

perl -pi.bak -e 's/(20[012][0-9])-20[12][01234]/$1-2025/g' `git ls-files`
2025-02-16 17:00:46 +00:00
Richard W.M. Jones
e2c7bddf10 Update copyright dates for 2023
Run this command across the source:

  perl -pi.bak -e 's/(20[012][0-9])-20[12][012]/$1-2023/g' `git ls-files`

and remove changes to po{,-docs}/*.po{,t} (these will be regenerated
later when we run 'make dist').
2023-02-07 10:50:48 +00:00
Richard W.M. Jones
dbc2fd8dc8 lib: Remove libguestfs live
This experimental feature allowed you (in theory) to connect to an
existing instance of the libguestfs daemon.  (Again, in theory) it
allowed you to attach to running guests.  This didn't work well in
practice.  If you want to do this, install qemu-guest-agent inside
your guest instead.

This also disables the --live options in guestfish and guestmount.
(The option now prints an error).

This was never supported in RHEL.

The daemon tests relied on this connection method to perform tests on
a bare daemon, so this removes those tests.  They were not especially
valuable.

See-also: https://bugzilla.redhat.com/798980
2022-03-09 09:27:19 +00:00
Richard W.M. Jones
5b29fba5b2 docs: Move shared POD for --keys-from-stdin to common code.
No functional change.
2020-07-30 14:06:45 +01:00
Richard W.M. Jones
0e17236d7d Update copyright dates to 2020. 2020-03-06 19:32:32 +00:00
Nikolay Ivanets
6b6bb44ebc tools: add '--blocksize' option for C-based tools
This patch adds '--blocksize' command line option for guestfish and
other C-based tools.  This option allows specifying disk sector size.
2020-02-17 12:32:03 +00:00
Richard W.M. Jones
8ba0457e9e options: Update documentation for --key SELECTOR.
Use the common/options/key-option.pod fragment to document the --key
option and selector instead of duplicating the same documentation
everywhere.
2019-11-28 13:28:49 +00:00
Richard W.M. Jones
05d4fcb64d Update copyright dates for 2019.
This command run over the source:

perl -pi.bak -e 's/(20[01][0-9])-2018/$1-2019/g' `git ls-files`
2019-01-08 11:58:30 +00:00
Pino Toscano
4b1e5b0c3f Introduce a --key option in tools that accept keys
The majority of the tools have already options (--echo-keys &
--keys-from-stdin) to deal with LUKS credentials, although there is no
way to automatically provide credentials.  --keys-from-stdin is
suboptimal, because it is a usable solution only when there is just one
device to open, and no other input passed via stdin to the tool (like
the commands for guestfish).

To overcome this limitation, introduce a new --key option in tools:
* --key /dev/device:file:/filename/with/key
* --key /dev/device:string:the-actual-key
this way it is possible to pass all the credentials needed for the
specific devices to open, with no risk of conflict with stdin, and also
in a secure way (when using the "file" way).

On the technical side: this adds a new "key_store" API for the C tools,
making sure it is used only when needed.  Partially mirror it also for
the OCaml tools, although there will be a conversion to the C API
because the decryption helpers used are in the common C parts.
2018-09-21 10:30:05 +02:00
Richard W.M. Jones
212762c593 Update copyright dates for 2018.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2017/$1-2018/g' `git ls-files`
2018-01-04 15:30:10 +00:00
Richard W.M. Jones
5c86c64c79 fuse: Make it clearer that -o allow_other must be enabled in /etc/fuse.conf.
It wasn't very clear in the manual before.
2017-07-19 11:50:16 +01:00
Richard W.M. Jones
ee206d7ba8 Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
Only in end-user messages and documentation.  This change was done
mostly mechanically using the Perl script attached below.

I also changed don't -> don’t etc and made some other simple fixes.

See also: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html

----------
 #!/usr/bin/perl -w

use strict;
use Locale::PO;

my $re = qr{'([-\w%.,=?*/]+)'};

my %files = ();

foreach my $filename ("po/libguestfs.pot", "po-docs/libguestfs-docs.pot") {
    my $poref = Locale::PO->load_file_asarray($filename);

    foreach my $po (@$poref) {
        if ($po->msgid =~ $re) {
            my @refs = split /\s+/, $po->reference;
            foreach my $ref (@refs) {
                my ($file, $lineno) = split /:/, $ref, 2;
                $file =~ s{^\.\./}{};
                if (exists $files{$file}) {
                    push @{$files{$file}}, $lineno;
                } else {
                    $files{$file} = [$lineno];
                }
            }
        }
    }
}

foreach my $file (sort keys %files) {
    unless (-w $file) {
        warn "warning: $file is probably generated\n"; # have to edit generator
        next;
    }
    my @lines = sort { $a <=> $b } @{$files{$file}};

    #print "editing $file at lines ", join (", ", @lines), " ...\n";
    open FILE, "<$file" or die "$file: $!";
    my @all = ();
    push @all, $_ while <FILE>;
    close FILE;

    my $ext = $file;
    $ext =~ s/^.*\.//;

    foreach (@lines) {
        # Don't mess with verbatim sections in POD files.
        next if $ext eq "pod" && $all[$_-1] =~ m/^ /;

        unless ($all[$_-1] =~ $re) {
            # this can happen for multi-line strings, have to edit it
            # by hand
            warn "warning: $file:$_ does not contain expected content\n";
            next;
        }
        $all[$_-1] =~ s/$re/‘$1’/g;
    }

    rename "$file", "$file.bak";
    open FILE, ">$file" or die "$file: $!";
    print FILE $_ for @all;
    close FILE;
    my $mode = (stat ("$file.bak"))[2];
    chmod ($mode & 0777, "$file");
}
2017-04-04 18:47:37 +01: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
08e27451a6 tests: Add script to check documented tool options match actual options.
podcheck.pl is run as part of the tests to perform various checks on
the documentation and the tool.

Currently we check only that the documented options matches the
options that the tool implements and vice versa.  This commit would
also allow us (in future) to check --help, --long-options,
--short-options, --version output.

This commit includes scripts to run the tests and various fixes to the
manual pages to ensure that the tests pass.
2016-07-19 13:06:14 +01:00
Richard W.M. Jones
35bac3a650 lib: Deprecate old SELinux APIs, rewrite SELinux documentation (RHBZ#1152825).
Also turns the --selinux option of guestfish, guestmount and
virt-rescue into a no-op -- it didn't work before so this is
effectively no change.
2016-07-14 15:28:10 +01:00
Richard W.M. Jones
446f7794e0 podwrapper: Add --warning flag for manual pages of CLI tools (RHBZ#1293527).
This doesn't add --warning flags to the translated pages,
which is a bug to be fixed at some point.
2016-01-11 13:42:49 +00: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
533901409e pod: Use F<> for filenames instead of C<>.
Done using a sequence of regular expressions like this:

  perl -pi.bak -e 's{C</}{F</}g' `git ls-files \*.pod` generator/actions.ml
  perl -pi.bak -e 's{C<C:\\}{F<C:\\}g' `git ls-files \*.pod` generator/actions.ml
  [etc]

and then tediously checking every change by hand.
2015-06-15 15:42:46 +01:00
Richard W.M. Jones
403e32df23 fuse: Add a note about preserving inode numbers using -o use_ino.
Thanks: David Juran
2015-03-27 11:01:00 +00:00
Richard W.M. Jones
c5800dc97d Update copyright dates for 2015. 2015-01-17 09:08:15 +00:00
Richard W.M. Jones
145c7ed5ee fuse: Add guestmount --fd option (RHBZ#1100498).
This implements the guestmount --fd option to allow you to run
guestmount captive under another process (typically using
`guestmount --fd=<FD> --no-fork').

See: https://bugzilla.redhat.com/show_bug.cgi?id=1100498
2014-05-24 18:11:20 +01: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
Pino Toscano
8b1f1c15f5 fish: use XDG paths for the config file
Read the configuration file from XDG paths for both global and
user-local locations, keeping the old paths as fallback.
2014-02-18 10:44:49 +01:00
Richard W.M. Jones
6c971faecf Update copyright dates for 2014. 2014-01-02 16:53:34 +00:00
Richard W.M. Jones
24a315507d Add man page for /etc/libguestfs-tools.conf (RHBZ#1019889).
Add a man page to document this configuration file.  This is
required by some distros, eg. Debian and RHEL.
2013-10-17 15:23:40 +01:00
Dave Vasilevsky
a820e9e3bd fuse: Document the fstype parameter 2013-05-09 08:42:55 +01:00
Richard W.M. Jones
349300af08 fish: Add -a URI (add remote storage) to options.
Add a remote drive by doing:

 guestfish -a ssh://example.com/path/to/disk.img

There are several different protocols supported, as explained in the
man page.

This affects all virt-* tools that use the common guestfish options
parsing code.
2013-04-16 15:28:31 +01:00
Richard W.M. Jones
6039689344 guestmount: Add --no-fork flag.
This prevent guestmount from daemonizing.
2013-03-05 14:40:27 +00:00
Richard W.M. Jones
3e9e40aee3 fuse: Add guestunmount program to handle unmounting (RHBZ#916780). 2013-03-05 13:12:25 +00:00
Richard W.M. Jones
0d18a8b407 Update copyright dates for 2013. 2013-02-02 13:56:19 +00: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
ec0c7e0a1a fuse: Cleaner code and documentation for safe cleanups. 2012-07-10 19:03:19 +01:00
Richard W.M. Jones
5546ea6d68 fuse: Add guestmount --pid-file option (RHBZ#838592). 2012-07-09 16:10:24 +01:00
Richard W.M. Jones
bfbfe6dd78 fuse: Link to mount-local documentation in guestmount man page. 2012-07-09 15:24:26 +01:00
Richard W.M. Jones
1cde66165a fuse: Document race condition possible with fusermount.
See also:
https://bugzilla.redhat.com/show_bug.cgi?id=835466#c9
2012-07-09 15:23:52 +01:00
Richard W.M. Jones
b749dc7074 fuse: Document Device or resource busy errors from fusermount. 2012-07-09 15:23:09 +01:00
Richard W.M. Jones
f5c31db5ed fuse: Fix documentation for call to virt-filesystems.
virt-filesystems requires -a/-d option.
2012-03-26 18:28:24 +01:00
Richard W.M. Jones
08840bab44 Tempus fugit.
Update all copyright dates to 2012.
2012-01-18 22:05:02 +00:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Richard W.M. Jones
b0eabcca60 guestmount: Fix --live option (RHBZ#744795). 2011-10-26 20:53:30 +01:00
Richard W.M. Jones
e57c3c37a8 guestmount: Add note to man page about 'fuse' group for Debian. 2011-10-13 15:25:13 +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
a711777bed docs: Separate out combined =item 's in man pages.
Turn:

 =item B<-a> | B<--all>

into:

 =item B<-a>

 =item B<--all>

This gives a more natural-looking manual page, as well as making it
easier to directly link to these sections.
2011-07-16 15:20:29 +01:00
Richard W.M. Jones
b777a5a649 fuse: Add note about allowing other users to see filesystem (RHBZ#705200). 2011-05-17 19:51:37 +01:00
Richard W.M. Jones
87fb6d852d fish: Allow -d UUID (specify libvirt domains by UUID).
This applies in all the commands which use the common C option parsing
code, ie:

* guestfish
* guestmount
* virt-cat
* virt-df
* virt-filesystems
* virt-inspector
* virt-ls
* virt-rescue
2011-05-06 13:04:19 -04:00
Richard W.M. Jones
b8e1dee73a Add /etc/libguestfs-tools.conf configuration file.
This allows the default for --ro or --rw to be controlled for the
three tools guestfish, guestmount and virt-rescue.
2011-03-31 15:42:13 +01:00
Richard W.M. Jones
4e529e06a4 fish: fuse: Add -m dev:mnt:opts to allow mount options to be specified.
This lets you turn on ACLs and xattrs by doing:

  -m /dev/sda1:/:acl,user_xattr

The extra parameter is passed through to mount_options:

  libguestfs: trace: mount_options "acl,user_xattr" "/dev/sda1" "/"
2011-03-28 14:21:55 +01:00
Richard W.M. Jones
a20e5c00c3 fish: Add guestfish --live, guestmount --live options.
The other programs have the variable, but the flag is not enabled
either because it doesn't make sense or because the implications are
not well understood.
2011-02-03 18:50:45 +00:00
Richard W.M. Jones
85c0bf5308 fuse: Add more tracing for calls into guestmount functions. 2010-12-19 12:04:43 +00:00
Richard W.M. Jones
fbc2555903 New tool: virt-filesystems
This tool replaces virt-list-filesystems and virt-list-partitions with
a new tool written in C with a more uniform command line structure
and output.

This existing Perl tools are deprecated but remain indefinitely.
2010-11-23 10:22:08 +00:00