diff mbox series

[v4,3/4] QGA VSS: Print error in err_set

Message ID 20230710074639.996030-4-kkostiuk@redhat.com (mailing list archive)
State New, archived
Headers show
Series QGA VSS Logging | expand

Commit Message

Konstantin Kostiuk July 10, 2023, 7:46 a.m. UTC
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 qga/vss-win32/requester.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Thomas Huth July 10, 2023, 8:07 a.m. UTC | #1
On 10/07/2023 09.46, Konstantin Kostiuk wrote:
> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   qga/vss-win32/requester.cpp | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
> index e85b9bc633..f3eafacfc1 100644
> --- a/qga/vss-win32/requester.cpp
> +++ b/qga/vss-win32/requester.cpp
> @@ -26,9 +26,11 @@
>   
>   #define DEFAULT_VSS_BACKUP_TYPE VSS_BT_FULL
>   
> -#define err_set(e, err, fmt, ...)                                           \
> -    ((e)->error_setg_win32_wrapper((e)->errp, __FILE__, __LINE__, __func__, \
> -                                   err, fmt, ## __VA_ARGS__))
> +#define err_set(e, err, fmt, ...) {                                         \
> +    (e)->error_setg_win32_wrapper((e)->errp, __FILE__, __LINE__, __func__,  \
> +                                   err, fmt, ## __VA_ARGS__);               \
> +    qga_debug(fmt, ## __VA_ARGS__);                                         \
> +}
>   /* Bad idea, works only when (e)->errp != NULL: */
>   #define err_is_set(e) ((e)->errp && *(e)->errp)
>   /* To lift this restriction, error_propagate(), like we do in QEMU code */

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index e85b9bc633..f3eafacfc1 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -26,9 +26,11 @@ 
 
 #define DEFAULT_VSS_BACKUP_TYPE VSS_BT_FULL
 
-#define err_set(e, err, fmt, ...)                                           \
-    ((e)->error_setg_win32_wrapper((e)->errp, __FILE__, __LINE__, __func__, \
-                                   err, fmt, ## __VA_ARGS__))
+#define err_set(e, err, fmt, ...) {                                         \
+    (e)->error_setg_win32_wrapper((e)->errp, __FILE__, __LINE__, __func__,  \
+                                   err, fmt, ## __VA_ARGS__);               \
+    qga_debug(fmt, ## __VA_ARGS__);                                         \
+}
 /* Bad idea, works only when (e)->errp != NULL: */
 #define err_is_set(e) ((e)->errp && *(e)->errp)
 /* To lift this restriction, error_propagate(), like we do in QEMU code */