version


Description:

[ Version ( since = "1.0.58" ) ]
public Version version () throws Error

get the library version number

Return the libguestfs version number that the program is linked against.

Note that because of dynamic linking this is not necessarily the version of libguestfs that you compiled against. You can compile the program, and then at runtime dynamically link against a completely different libguestfs.so library.

This call was added in version 1.0.58. In previous versions of libguestfs there was no way to get the version number. From C code you can use dynamic linker functions to find out if this symbol exists (if it doesn't, then it’s an earlier version).

The call returns a structure with four elements. The first three (major, minor and release) are numbers and correspond to the usual version triplet. The fourth element (extra) is a string and is normally empty, but may be used for distro-specific information.

To construct the original version string: "$major.$minor.$release$extra"

See also: "LIBGUESTFS VERSION NUMBERS" in guestfs(3).

*Note:* Don't use this call to test for availability of features. In enterprise distributions we backport features from later versions into earlier versions, making this an unreliable way to test for features. Use available or feature_available instead.

Parameters:

this

A GuestfsSession object

Returns:

a Version object, or NULL on error




2022 vala-language.org