On 2/24/26 09:22, Laine Stump via Devel wrote:
> From: Laine Stump <[email protected]>
> 
> All the other wrapper functions for glib g_get_user_*_dir() have the
> type of directory (the "*" in that wildcarded name) in the libvirt
> function name. These functions, on the other hand, call
> g_get_home_dir(), but the libvirt API is called
> virGetUserDirectory*(). Let's make it *a bit* closer to consistent (at
> least the libvirt API names will be consistent with each other, even
> if glib isn't).
> 
> Signed-off-by: Laine Stump <[email protected]>
> ---
>  src/libvirt_private.syms        |  4 ++--
>  src/qemu/qemu_interop_config.c  |  2 +-
>  src/rpc/virnetclient.c          |  4 ++--
>  src/rpc/virnettlsconfig.c       |  2 +-
>  src/util/virutil.c              | 10 +++++-----
>  src/util/virutil.h              |  4 ++--
>  src/vbox/vbox_storage.c         |  2 +-
>  tools/virt-login-shell-helper.c |  2 +-
>  tools/vsh.c                     |  2 +-
>  9 files changed, 16 insertions(+), 16 deletions(-)
> 

> diff --git a/src/util/virutil.c b/src/util/virutil.c
> index fb64237692..3c0d04c3d7 100644
> --- a/src/util/virutil.c
> +++ b/src/util/virutil.c
> @@ -589,7 +589,7 @@ virGetHostnameQuiet(void)
>  
>  
>  char *
> -virGetUserDirectory(void)
> +virGetUserHomeDirectory(void)
>  {
>      return g_strdup(g_get_home_dir());
>  }
> @@ -753,7 +753,7 @@ static char *virGetGroupEnt(gid_t gid)
>  
>  
>  char *
> -virGetUserDirectoryByUID(uid_t uid)
> +virGetUserHomeDirectoryByUID(uid_t uid)
>  {
>      char *ret;
>      virGetUserEnt(uid, NULL, NULL, &ret, NULL, false);
> @@ -1091,7 +1091,7 @@ virDoesGroupExist(const char *name G_GNUC_UNUSED)
>  
>  # ifdef WIN32
>  char *
> -virGetUserDirectoryByUID(uid_t uid G_GNUC_UNUSED)
> +virGetUserHomeDirectoryByUID(uid_t uid G_GNUC_UNUSED)
>  {
>      /* Since Windows lacks setuid binaries, and since we already fake
>       * geteuid(), we can safely assume that this is only called when
> @@ -1111,10 +1111,10 @@ virGetUserShell(uid_t uid G_GNUC_UNUSED)
>  
>  # else /* !WITH_GETPWUID_R && !WIN32 */
>  char *
> -virGetUserDirectoryByUID(uid_t uid G_GNUC_UNUSED)
> +virGetUserHomeDirectoryByUID(uid_t uid G_GNUC_UNUSED)
>  {
>      virReportError(VIR_ERR_INTERNAL_ERROR,
> -                   "%s", _("virGetUserDirectory is not available"));
> +                   "%s", _("virGetUserHomeDirectory is not available"));

I think this should be either full function name, or an error message
not containing the function name at all (e.g. "getting home directory is
not available"). Partial function name is misleading IMO.

>  
>      return NULL;
>  }

Michal

Reply via email to