Signed-off-by: Konstantin Kostiuk <[email protected]> --- qga/vss-win32/vss-debug.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 qga/vss-win32/vss-debug.h
diff --git a/qga/vss-win32/vss-debug.h b/qga/vss-win32/vss-debug.h new file mode 100644 index 0000000000..c0bdf7a3fc --- /dev/null +++ b/qga/vss-win32/vss-debug.h @@ -0,0 +1,31 @@ +/* + * QEMU Guest Agent VSS debug declarations + * + * Copyright (C) 2023 Red Hat Inc + * + * Authors: + * Konstantin Kostiuk <[email protected]> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include <vss-handles.h> + +#ifndef VSS_DEBUG_H +#define VSS_DEBUG_H + +#define PRINT_DEBUG(fmt, ...) { \ + char user_sting[512] = { 0 }; \ + char full_string[640] = { 0 }; \ + snprintf(user_sting, 512, fmt, ## __VA_ARGS__); \ + snprintf(full_string, 640, QGA_PROVIDER_NAME"[%lu]: %s %s\n", \ + GetCurrentThreadId(), __func__, user_sting); \ + OutputDebugString(full_string); \ + fprintf(stderr, "%s", full_string); \ +} + +#define PRINT_DEBUG_BEGIN PRINT_DEBUG("begin") +#define PRINT_DEBUG_END PRINT_DEBUG("end") + +#endif -- 2.34.1
