tools: make libxenhypfs interface more future proof
authorJuergen Gross <jgross@suse.com>
Tue, 2 Jun 2020 06:00:21 +0000 (08:00 +0200)
committerWei Liu <wl@xen.org>
Tue, 2 Jun 2020 12:05:30 +0000 (12:05 +0000)
commitdde6174ada5280cd9a6396e3b12606360a0d29a3
treea3dc31f9ffee9054659652479f98407662d7892f
parent370b41113eaed780f109d708e4478a6bfb794459
tools: make libxenhypfs interface more future proof

As compilers are free to choose the width of an enum they should be
avoided in stable interfaces when declaring a variable. So the
struct xenhypfs_dirent definition should be modified to have explicitly
sized members for type and encoding and the related enums should be
defined separately.

Additionally it is better to have a larger flags member in that struct
with the "writable" indicator occupying only a single bit. This will
make future additions easier.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wl@xen.org>
Release-acked-by: Paul Durrant <paul@xen.org>
tools/libs/hypfs/core.c
tools/libs/hypfs/include/xenhypfs.h
tools/misc/xenhypfs.c