On 27.04.20 16:53, George Dunlap wrote:


On Apr 2, 2020, at 4:46 PM, Juergen Gross <jgr...@suse.com> wrote:

Add the new library libxenhypfs for access to the hypervisor filesystem.

Signed-off-by: Juergen Gross <jgr...@suse.com>
Acked-by: Wei Liu <w...@xen.org>

Just a few questions...

+/* Returned buffer and dirent should be freed via free(). */
+void *xenhypfs_read_raw(xenhypfs_handle *fshdl, const char *path,
+                        struct xenhypfs_dirent **dirent);
+
+/* Returned buffer should be freed via free(). */
+char *xenhypfs_read(xenhypfs_handle *fshdl, const char *path);

What’s the difference between these two?  And what’s the `dirent` argument to 
xenhypfs_read_raw() for?

xenhypfs_read() is returning the printable content (if possible),
e.g. "1" for an entry of type integer containing 0x00000001

xenhypfs_read_raw() returns the raw content (e.g. the binary
value 0x00000001 in above example) and the entry format data in
dirent (type, size and enconding of entry).


Juergen

Reply via email to