search for: version_struct_to_number

Displaying 4 results from an estimated 4 matches for "version_struct_to_number".

2016 May 18
3
[PATCH v2 0/2] src: introduce an helper version struct
Hi, this adds an helper version struct, and uses it in the backends (for the libvirt and qemu versions) and inspection code. This also moves common code to that, so it is not repeated in many places. This should help with the small refactoring proposed with https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html Thanks, Pino Toscano (2): src: start unifying version handling
2016 May 17
3
[PATCH 0/2] src: introduce an helper version struct
Hi, this adds an helper version struct, and uses it in the backends (for the libvirt and qemu versions) and inspection code. This also moves common code to that, so it is not repeated in many places. This should help with the small refactoring proposed with https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html Thanks, Pino Toscano (2): src: start unifying version handling
2016 May 18
0
[PATCH 2/2] inspect: switch to version struct for os major/minor version
...uestfs.h" #include "guestfs-internal.h" @@ -25,9 +30,13 @@ * This file provides simple version number management. */ +COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) + #define VERSION_TO_NUMBER(maj, min, mic) ((maj) * 1000000 + (min) * 1000 + (mic)) #define VERSION_STRUCT_TO_NUMBER(v) VERSION_TO_NUMBER((v)->v_major, (v)->v_minor, (v)->v_micro) +static int version_from_x_y_or_x (guestfs_h *g, struct version *v, const char *str, const pcre *re, bool allow_only_x); + void guestfs_int_version_from_libvirt (struct version *v, int vernum) { @@ -44,8 +53,93 @@ guestfs_...
2016 May 17
0
[PATCH 1/2] src: start unifying version handling
..., Boston, MA 02110-1301 USA + */ + +#include <config.h> + +#include "guestfs.h" +#include "guestfs-internal.h" + +/** + * This file provides simple version number management. + */ + +#define VERSION_TO_NUMBER(maj, min, mic) ((maj) * 1000000 + (min) * 1000 + (mic)) +#define VERSION_STRUCT_TO_NUMBER(v) VERSION_TO_NUMBER((v)->v_major, (v)->v_minor, (v)->v_micro) + +void +guestfs_int_version_from_libvirt (struct version *v, int vernum) +{ + v->v_major = vernum / 1000000UL; + v->v_minor = vernum / 1000UL % 1000UL; + v->v_micro = vernum % 1000UL; +} + +void +guestfs_int_versio...