diff mbox

[v2,03/15] qga: Consistently name Error ** objects errp, and not err

Message ID 1398716874-18699-4-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster April 28, 2014, 8:27 p.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 qga/commands-posix.c | 10 +++++-----
 qga/commands-win32.c | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

Comments

Michael Roth April 29, 2014, 9:20 p.m. UTC | #1
Quoting Markus Armbruster (2014-04-28 15:27:42)
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> ---
>  qga/commands-posix.c | 10 +++++-----
>  qga/commands-win32.c | 10 +++++-----
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index e49c7da..f6af7d1 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -839,14 +839,14 @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp)
> 
>  static void guest_fsfreeze_cleanup(void)
>  {
> -    Error *errp = NULL;
> +    Error *err = NULL;

*local_err?

I have it in my head we're doing *err and **errp for function signatures, and
*local_err for code body, but I missed the previous series so if that's not
how we did those conversions then nm me.

> 
>      if (ga_is_frozen(ga_state) == GUEST_FSFREEZE_STATUS_FROZEN) {
> -        qmp_guest_fsfreeze_thaw(&errp);
> -        if (errp) {
> +        qmp_guest_fsfreeze_thaw(&err);
> +        if (err) {
>              slog("failed to clean up frozen filesystems: %s",
> -                 error_get_pretty(errp));
> -            error_free(errp);
> +                 error_get_pretty(err));
> +            error_free(err);
>          }
>      }
>  }
> diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> index 7e7df73..d0d8504 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -227,18 +227,18 @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp)
> 
>  static void guest_fsfreeze_cleanup(void)
>  {
> -    Error *errp = NULL;
> +    Error *err = NULL;
> 
>      if (!vss_initialized()) {
>          return;
>      }
> 
>      if (ga_is_frozen(ga_state) == GUEST_FSFREEZE_STATUS_FROZEN) {
> -        qmp_guest_fsfreeze_thaw(&errp);
> -        if (errp) {
> +        qmp_guest_fsfreeze_thaw(&err);
> +        if (err) {
>              slog("failed to clean up frozen filesystems: %s",
> -                 error_get_pretty(errp));
> -            error_free(errp);
> +                 error_get_pretty(err));
> +            error_free(err);
>          }
>      }
> 
> -- 
> 1.8.1.4
Markus Armbruster April 30, 2014, 6:41 a.m. UTC | #2
Michael Roth <mdroth@linux.vnet.ibm.com> writes:

> Quoting Markus Armbruster (2014-04-28 15:27:42)
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> ---
>>  qga/commands-posix.c | 10 +++++-----
>>  qga/commands-win32.c | 10 +++++-----
>>  2 files changed, 10 insertions(+), 10 deletions(-)
>> 
>> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
>> index e49c7da..f6af7d1 100644
>> --- a/qga/commands-posix.c
>> +++ b/qga/commands-posix.c
>> @@ -839,14 +839,14 @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp)
>> 
>>  static void guest_fsfreeze_cleanup(void)
>>  {
>> -    Error *errp = NULL;
>> +    Error *err = NULL;
>
> *local_err?
>
> I have it in my head we're doing *err and **errp for function signatures, and
> *local_err for code body, but I missed the previous series so if that's not
> how we did those conversions then nm me.

Perhaps we started with such a rule in mind, but the code doesn't comply
to it now.

I can try to apply the rule in qga/ if you like, just tell me.

[...]
diff mbox

Patch

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index e49c7da..f6af7d1 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -839,14 +839,14 @@  int64_t qmp_guest_fsfreeze_thaw(Error **errp)
 
 static void guest_fsfreeze_cleanup(void)
 {
-    Error *errp = NULL;
+    Error *err = NULL;
 
     if (ga_is_frozen(ga_state) == GUEST_FSFREEZE_STATUS_FROZEN) {
-        qmp_guest_fsfreeze_thaw(&errp);
-        if (errp) {
+        qmp_guest_fsfreeze_thaw(&err);
+        if (err) {
             slog("failed to clean up frozen filesystems: %s",
-                 error_get_pretty(errp));
-            error_free(errp);
+                 error_get_pretty(err));
+            error_free(err);
         }
     }
 }
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 7e7df73..d0d8504 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -227,18 +227,18 @@  int64_t qmp_guest_fsfreeze_thaw(Error **errp)
 
 static void guest_fsfreeze_cleanup(void)
 {
-    Error *errp = NULL;
+    Error *err = NULL;
 
     if (!vss_initialized()) {
         return;
     }
 
     if (ga_is_frozen(ga_state) == GUEST_FSFREEZE_STATUS_FROZEN) {
-        qmp_guest_fsfreeze_thaw(&errp);
-        if (errp) {
+        qmp_guest_fsfreeze_thaw(&err);
+        if (err) {
             slog("failed to clean up frozen filesystems: %s",
-                 error_get_pretty(errp));
-            error_free(errp);
+                 error_get_pretty(err));
+            error_free(err);
         }
     }