Re: [libvirt] [PATCH 03/75] access: Drop virAsprintf() and virAsprintfQuiet() retval checking

2019-10-22 Thread Michal Privoznik

On 10/22/19 4:09 PM, Daniel P. Berrangé wrote:

On Tue, Oct 22, 2019 at 03:57:07PM +0200, Michal Privoznik wrote:

These functions can't fail really. Drop checking of their retval
then.


These are declared G_GNUC_WARN_UNUSED_RESULT so this will surely
result in a broken build when bisecting.

When I added the abort-on-OOM logic I intentionally left the
G_GNUC_WARN_UNUSED_RESULT annotation in place, as I didn't
want us to go through the step of dropping the return value
checking, instead wanting to go straight to g_strdup_printf
in one go to reduce the number of patches.

With this in mind, IMHO the first half of this series is redundant
and each patch should be squashed into the corresponding patch in
the second half of this series.


D'oh! I had it in one big patch (which compiled just fine) and only 
after that I've split it into smaller patches. You suggestion makes 
sense, I can do that. But I know Jano is looking at patches so I'll wait 
for his review.


Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 03/75] access: Drop virAsprintf() and virAsprintfQuiet() retval checking

2019-10-22 Thread Daniel P . Berrangé
On Tue, Oct 22, 2019 at 03:57:07PM +0200, Michal Privoznik wrote:
> These functions can't fail really. Drop checking of their retval
> then.

These are declared G_GNUC_WARN_UNUSED_RESULT so this will surely
result in a broken build when bisecting.

When I added the abort-on-OOM logic I intentionally left the
G_GNUC_WARN_UNUSED_RESULT annotation in place, as I didn't
want us to go through the step of dropping the return value
checking, instead wanting to go straight to g_strdup_printf
in one go to reduce the number of patches.

With this in mind, IMHO the first half of this series is redundant
and each patch should be squashed into the corresponding patch in
the second half of this series.

> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/access/viraccessdriverpolkit.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/access/viraccessdriverpolkit.c 
> b/src/access/viraccessdriverpolkit.c
> index 496210fabe..5d6c4204ff 100644
> --- a/src/access/viraccessdriverpolkit.c
> +++ b/src/access/viraccessdriverpolkit.c
> @@ -59,10 +59,8 @@ virAccessDriverPolkitFormatAction(const char *typename,
>  char *actionid = NULL;
>  size_t i;
>  
> -if (virAsprintf(, "%s.%s.%s",
> -VIR_ACCESS_DRIVER_POLKIT_ACTION_PREFIX,
> -typename, permname) < 0)
> -return NULL;
> +virAsprintf(, "%s.%s.%s", 
> VIR_ACCESS_DRIVER_POLKIT_ACTION_PREFIX,
> +typename, permname);
>  
>  for (i = 0; actionid[i]; i++)
>  if (actionid[i] == '_')
> -- 
> 2.21.0
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH 03/75] access: Drop virAsprintf() and virAsprintfQuiet() retval checking

2019-10-22 Thread Michal Privoznik
These functions can't fail really. Drop checking of their retval
then.

Signed-off-by: Michal Privoznik 
---
 src/access/viraccessdriverpolkit.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/access/viraccessdriverpolkit.c 
b/src/access/viraccessdriverpolkit.c
index 496210fabe..5d6c4204ff 100644
--- a/src/access/viraccessdriverpolkit.c
+++ b/src/access/viraccessdriverpolkit.c
@@ -59,10 +59,8 @@ virAccessDriverPolkitFormatAction(const char *typename,
 char *actionid = NULL;
 size_t i;
 
-if (virAsprintf(, "%s.%s.%s",
-VIR_ACCESS_DRIVER_POLKIT_ACTION_PREFIX,
-typename, permname) < 0)
-return NULL;
+virAsprintf(, "%s.%s.%s", VIR_ACCESS_DRIVER_POLKIT_ACTION_PREFIX,
+typename, permname);
 
 for (i = 0; actionid[i]; i++)
 if (actionid[i] == '_')
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list