37 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
0e17236d7d Update copyright dates to 2020. 2020-03-06 19:32:32 +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
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
Matteo Cafasso
d00dc913aa New API: internal_yara_scan
The internal_yara_scan runs the Yara engine with the previously loaded
rules against the given file.

For each rule matching against the scanned file, a struct containing
the file name and the rule identifier is returned.

The gathered list of yara_detection structs is serialised into XDR format
and written to a file.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2017-05-02 13:34:42 +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
Matteo Cafasso
3de8abac4a New API: internal_filesystem_walk
- generator: Added tsk_dirent struct

The tsk_dirent struct contains the information gathered via TSK APIs.

The struct contains the following fields:
 * tsk_inode: inode of a file
 * tsk_type: type of file such as for dirwalk command
 * tsk_size: file size in bytes
 * tsk_name: path relative to its disk partition
 * tsk_flags: bitfield containing extra information
 * tsk_spare[1-5]: extra space for future usage

 - configure: Added libtsk compile-time check

Ensure libtsk is available at compile time.
If not, daemon routines depending on it won't be available.

 - API: internal_filesystem_walk

The internal_filesystem_walk command walks through the FS structures
of a disk partition and returns all the files or directories
which could be found.

The command is able to retrieve information regarding deleted
or unaccessible files where other commands such as stat or find
would fail.

The gathered list of tsk_dirent structs is serialised into XDR format
and written to a file by the appliance.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-06-22 18:43:51 +01:00
Richard W.M. Jones
ae3c051567 generator: Declare which input file(s) generate each output file. 2016-02-23 10:40:06 +00:00
Richard W.M. Jones
52b5ddf23e generator: Make the 'this file is generated' warning clearer.
Also rename the ~extra_inputs parameter as plain ~inputs.  We will use
~inputs more widely in following commit.
2016-02-23 10:40:06 +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
Hu Tao
f265371868 New API: btfs_scrub_status
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-02-16 18:05:30 +00:00
Hu Tao
88dbae4cbf New API: btrfs_balance_status
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-02-16 18:05:30 +00:00
Richard W.M. Jones
9d9ef2960c Version 1.29.20. 2015-01-17 11:45:31 +00:00
Hu Tao
2b7f7810ed New API: btrfs_qgroup_show
btrfs_qgroup_show shows all qgroups on a btrfs filesystem.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
2014-12-15 16:22:46 +00:00
Richard W.M. Jones
8664337cc3 New APIs: Implement stat calls that return nanosecond timestamps (RHBZ#1144891).
The existing APIs guestfs_stat, guestfs_lstat and guestfs_lstatlist
return a stat structure that contains atime, mtime and ctime fields
that store only the timestamp in seconds.

Modern filesystems can store timestamps down to nanosecond
granularity, and the ordinary glibc stat(2) wrapper will return these
in "hidden" stat fields:

  struct timespec st_atim;            /* Time of last access.  */
  struct timespec st_mtim;            /* Time of last modification.  */
  struct timespec st_ctim;            /* Time of last status change.  */

with the following macros defined for backwards compatibility:

  #define st_atime st_atim.tv_sec
  #define st_mtime st_mtim.tv_sec
  #define st_ctime st_ctim.tv_sec

It is not possible to redefine guestfs_stat to return a longer struct
guestfs_stat with room for the extra nanosecond fields, because that
would break the ABI of guestfs_lstatlist as it returns an array
containing consecutive stat structs (not pointers).  Changing the
return type of guestfs_stat would break API.  Changing the generator
to support symbol versioning is judged to be too intrusive.

Therefore this adds a new struct (guestfs_statns) and new APIs:

  guestfs_statns
  guestfs_lstatns
  guestfs_lstatnslist

which return the new struct (or array of structs in the last case).

The old APIs may of course still be used, forever, but are deprecated
and shouldn't be used in new programs.

Because virt tools are compiled with -DGUESTFS_WARN_DEPRECATED=1, I
have updated all the places calling the deprecated functions.  This
has revealed some areas for improvement: in particular virt-diff and
virt-ls could be changed to print the nanosecond fields.

FUSE now returns nanoseconds in stat calls where available, fixing
https://bugzilla.redhat.com/show_bug.cgi?id=1144891

Notes about the implementation:

- guestfs_internal_lstatlist has been removed and replaced by
  guestfs_internal_lstatnslist.  As the former was an internal API no
  one should have been calling it, or indeed can call it unless they
  start defining their own header files.

- guestfs_stat and guestfs_lstat have been changed into library-side
  functions.  They, along with guestfs_lstatlist, are now implemented
  as wrappers around the new functions which just throw away the
  nanosecond fields.
2014-09-22 15:47:48 +01:00
Richard W.M. Jones
6c971faecf Update copyright dates for 2014. 2014-01-02 16:53:34 +00:00
Richard W.M. Jones
20e23ab2a3 Update copyright dates for 2013.
On generated files in git and README.
2013-01-15 18:40:16 +00:00
John Eckersberg
bafd822914 lib: Add inspect_list_applications2 method (RHBZ#859949)
RWMJ:
- Fix memory leak in guestfs__inspect_list_applications wrapper.
- Don't document app2_spare* fields.
2012-11-01 18:22:01 +00:00
Richard W.M. Jones
a3d7f5bc17 generator: The default input files are 'generator/ *.ml' [sic].
Since generator source files were renamed, the comment at the
top of each generated file was wrong.

Unfortunately we cannot allow /* to appear within a comment,
so the space is necessary.
2012-09-24 09:34:33 +01:00
Richard W.M. Jones
8a723ca62e New APIs: hivex_*
Transscribe many hivex(3) APIs into the libguestfs API.

There is one hive handle per libguestfs handle, as with Augeas.

Note that hivex uses iconv_open for some APIs (eg. hivex_value_string).
But since we delete all the i18n files from the appliance, this
doesn't work -- iconv_open returns EINVAL.  Therefore hivex APIs which
require iconv cannot be bound in the daemon.
2012-08-29 17:08:01 +01:00
Richard W.M. Jones
b075b4d1fe New API: utsname
Typical output:

><fs> utsname
uts_sysname: Linux
uts_release: 3.5.0-1.fc18.x86_64
uts_version: #1 SMP Mon Jul 23 17:43:39 UTC 2012
uts_machine: x86_64
2012-07-30 15:16:45 +01:00
Wanlong Gao
87206e4e9e New API: add new api xfs_info
Add xfs_info to show the geometry of the xfs filesystem.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>

RWMJ:
 - Updated po/POTFILES.
 - Use xfs_ prefix for all struct fields.
 - Return uninitialized fields as -1 / empty string.
 - Copyedit the description.
2012-07-18 09:37:17 +01:00
Richard W.M. Jones
87ea7a0409 New btrfs APIs.
Bind the easy parts of the 'btrfs' program.

The new APIs are:

btrfs-device-add: add devices to a btrfs filesystem
btrfs-device-delete: remove devices from a btrfs filesystem
btrfs-filesystem-sync: sync a btrfs filesystem
btrfs-filesystem-balance: balance a btrfs filesystem
btrfs-subvolume-create: create a btrfs snapshot
btrfs-subvolume-delete: delete a btrfs snapshot
btrfs-subvolume-list: list btrfs snapshots and subvolumes
btrfs-subvolume-set-default: set default btrfs subvolume
btrfs-subvolume-snapshot: create a writable btrfs snapshot
2012-04-25 17:32:30 +01:00
Richard W.M. Jones
3f6cc550ff New API: md-stat.
This returns information about the underlying devices of an MD
(software RAID) device.
2012-03-20 18:50:24 +00:00
Richard W.M. Jones
14938b46a7 generator: Sort camel-case structs. 2012-03-16 14:42:30 +00:00
Richard W.M. Jones
a43f35f5bb New APIs: isoinfo and isoinfo-device.
Get ISO primary volume descriptor information for either ISO devices
or ISO files.
2012-03-16 14:40:20 +00:00
Matthew Booth
ebdda911b5 Tempora mutantur, nos et mutamur in illis. 2012-01-04 12:32:35 +00:00
Richard W.M. Jones
62c47b7431 Tempora mutantur, nos et mutamur in illis. 2011-01-02 16:50:39 +00:00
Richard W.M. Jones
163be3d72a New API: inspect-list-applications.
This converts the current Perl code in virt-inspector for
listing applications, into C, making it a part of the core API.

This is also capable of fetching the list of Windows applications
from the registry.
2010-11-15 22:25:16 +00: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
Richard Jones
d3c615c2d6 Update copyright years. 2010-01-02 19:47:37 +00:00
Richard Jones
2e2eb15df0 Remove separate inspector_generator.ml, combine this with generator.ml.
This commit combines the previously separate "inspector_generator.ml"
program which generated bindings for virt-inspector.

Having two separate programs caused no end of troubles for developers,
so we now combine them into a single program.

NOTE: OCaml xml-light is now *required* in order to rebuild the
generated code.
2009-12-31 11:20:56 +00:00
Richard Jones
b1e1ca2f74 Generic partition creation interface.
This commit introduces a generic partition creation interface
which should be future-proof and extensible, and partially
replaces the old sfdisk-based interface.

The implementation is based on parted but is hopefully not too
dependent on the particulars of parted.

The following new calls are introduced:

  guestfs_part_init:
    Initialize a disk with a partition table.  Unlike the sfdisk-
    based interface, we also support GPT and other partition
    types, which is essential to scale to devices larger than 2TB.

  guestfs_part_add: Add a partition to an existing disk.

  guestfs_part_disk:
    Convenience function which combines part_init & part_add,
    creating a single partition that covers the whole disk.

  guestfs_part_set_bootable:
  guestfs_part_set_name:
    Set various aspects of existing partitions.

  guestfs_part_list:
    List partitions on a device.  This returns a programming-friendly
    list of partition structs (in contrast to sfdisk-l which cannot
    be parsed).

  guestfs_part_get_parttype:
    Return the partition table type, eg. "msdos" or "gpt".

The following calls are planned, but not added currently:

  guestfs_part_get_bootable
  guestfs_part_get_name
  guestfs_part_set_type
  guestfs_part_get_type
2009-11-10 16:32:20 +00:00
Richard Jones
c8419d45c8 Tidy up generation of java/Makefile.inc.
(Just whitespace and comment changes, and small restructuring
of the code).
2009-08-07 17:38:44 +01:00
Richard W.M. Jones
4610db9f1b Add interface to Linux 'inotify' API. 2009-07-31 23:30:42 +01:00
Richard W.M. Jones
f67babb756 java/Makefile.inc: Include this generated file.
We have to include this generated file because it is part of
the build system, thus required to exist before the generator
runs.
2009-07-14 16:20:03 +01:00