diff mbox series

[RFC,v3,5/7] libs: libxenhypfs - handle blob properties

Message ID 20250311111618.1850927-6-grygorii_strashko@epam.com (mailing list archive)
State New
Headers show
Series xen/arm: scmi: introduce SCI SCMI SMC multi-agent support | expand

Commit Message

Grygorii Strashko March 11, 2025, 11:16 a.m. UTC
From: Oleksii Moisieiev <oleksii_moisieiev@epam.com>

libxenhypfs will return blob properties as is. This output can be used
to retrieve information from the hypfs. Caller is responsible for
parsing property value.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 tools/libs/hypfs/core.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Juergen Gross March 11, 2025, 11:26 a.m. UTC | #1
On 11.03.25 12:16, Grygorii Strashko wrote:
> From: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> 
> libxenhypfs will return blob properties as is. This output can be used
> to retrieve information from the hypfs. Caller is responsible for
> parsing property value.
> 
> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> ---
>   tools/libs/hypfs/core.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/tools/libs/hypfs/core.c b/tools/libs/hypfs/core.c
> index 52b30db8d777..d09bba7d8c86 100644
> --- a/tools/libs/hypfs/core.c
> +++ b/tools/libs/hypfs/core.c
> @@ -307,8 +307,6 @@ char *xenhypfs_read(xenhypfs_handle *fshdl, const char *path)
>           errno = EISDIR;
>           break;
>       case xenhypfs_type_blob:
> -        errno = EDOM;
> -        break;
>       case xenhypfs_type_string:
>           ret_buf = buf;
>           buf = NULL;

You are losing the size information. So you can only parse the blob
if the size is known or the blob is containing the size.

Any reason you don't want to use xenhypfs_read_raw(), which is
available exactly for that purpose?


Juergen
diff mbox series

Patch

diff --git a/tools/libs/hypfs/core.c b/tools/libs/hypfs/core.c
index 52b30db8d777..d09bba7d8c86 100644
--- a/tools/libs/hypfs/core.c
+++ b/tools/libs/hypfs/core.c
@@ -307,8 +307,6 @@  char *xenhypfs_read(xenhypfs_handle *fshdl, const char *path)
         errno = EISDIR;
         break;
     case xenhypfs_type_blob:
-        errno = EDOM;
-        break;
     case xenhypfs_type_string:
         ret_buf = buf;
         buf = NULL;