From nobody Mon Jun 24 12:22:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1688721856; cv=none; d=zohomail.com; s=zohoarc; b=m51CFhEeALcAFlARGauac+ebOzCfmCIH5sl916hhWMYbe3SNoeyFylQqIZgu9++jETDyNZVOXg+eTFs31+pBsyVm44h9a+WIkBouyWOovKMsCJBv4BA4GtzXZx8rbgu1RIOhz8UsaV3eHAk1ZUI4HCwiTww9kqn5Ah12mF3AS/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688721856; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=04pRwOWQRoiMg4VihAo/WFWbwd0jdS9TiDccmTDbhD0=; b=lFgwnNeeY2ujLe4+aMVBER8uben+Gec1BY/2jbDoGszlEWG4axU1zaXDshZWN1b+52Sc1kzjM9sfIAJlR4Z2D51xJDhhwbp830YC5dGj/RZ6BbG0wrm6lz0m4rL0qqrfR0Cb450F/+kWW/fGmIwcYMwxjf0NNXzeWtgicuQU6jM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688721856289717.0496407439553; Fri, 7 Jul 2023 02:24:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHhgK-00077C-EY; Fri, 07 Jul 2023 05:23:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhgE-00076N-Ha for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:23:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhgC-0001JP-7o for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:23:10 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-252-D6HEg64OMG-u9l40OZGzMQ-1; Fri, 07 Jul 2023 05:23:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68204856F67; Fri, 7 Jul 2023 09:23:03 +0000 (UTC) Received: from kostyanf14nb.redhat.com (unknown [10.45.225.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 388784067A00; Fri, 7 Jul 2023 09:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688721786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=04pRwOWQRoiMg4VihAo/WFWbwd0jdS9TiDccmTDbhD0=; b=JXMm8YpMC94GUdpEkul5KOexjKYlWobhdsW0hKQxxWew3OmSSOnmcYXYJSTEiOMWV+TCC2 uZYmKynvQRJcvn6MJdmb873BkulApQhkYAQQX75Q7aG17HnsnUkdhBl/cDzOePVUme857c Or/MSYPGJdSWTfHapkL2pdEHRng5A0U= X-MC-Unique: D6HEg64OMG-u9l40OZGzMQ-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Roth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/4] QGA VSS: Add wrapper to send log to debugger and stderr Date: Fri, 7 Jul 2023 12:22:55 +0300 Message-Id: <20230707092258.768420-2-kkostiuk@redhat.com> In-Reply-To: <20230707092258.768420-1-kkostiuk@redhat.com> References: <20230707092258.768420-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1688721857385100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- qga/vss-win32/meson.build | 2 +- qga/vss-win32/vss-debug.cpp | 31 +++++++++++++++++++++++++++++++ qga/vss-win32/vss-debug.h | 25 +++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 qga/vss-win32/vss-debug.cpp create mode 100644 qga/vss-win32/vss-debug.h diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build index 9483ccd3b8..0ac918910b 100644 --- a/qga/vss-win32/meson.build +++ b/qga/vss-win32/meson.build @@ -7,7 +7,7 @@ link_args =3D cc.get_supported_link_arguments([ =20 qga_vss =3D shared_module( 'qga-vss', - ['requester.cpp', 'provider.cpp', 'install.cpp', genh], + ['requester.cpp', 'provider.cpp', 'install.cpp', 'vss-debug.cpp', genh], name_prefix: '', cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno= -non-virtual-dtor'], link_args: link_args, diff --git a/qga/vss-win32/vss-debug.cpp b/qga/vss-win32/vss-debug.cpp new file mode 100644 index 0000000000..5d6f37944b --- /dev/null +++ b/qga/vss-win32/vss-debug.cpp @@ -0,0 +1,31 @@ +/* + * QEMU Guest Agent VSS debug declarations + * + * Copyright (C) 2023 Red Hat Inc + * + * Authors: + * Konstantin Kostiuk + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "vss-debug.h" +#include "vss-common.h" + +void qga_debug_internal(const char *funcname, const char *fmt, ...) { + char user_sting[512] =3D {0}; + char full_string[640] =3D {0}; + + va_list args; + va_start(args, fmt); + vsnprintf(user_sting, 512, fmt, args); + va_end(args); + + snprintf(full_string, 640, QGA_PROVIDER_NAME "[%lu]: %s %s\n", + GetCurrentThreadId(), funcname, user_sting); + + OutputDebugString(full_string); + fprintf(stderr, "%s", full_string); +} diff --git a/qga/vss-win32/vss-debug.h b/qga/vss-win32/vss-debug.h new file mode 100644 index 0000000000..7800457392 --- /dev/null +++ b/qga/vss-win32/vss-debug.h @@ -0,0 +1,25 @@ +/* + * QEMU Guest Agent VSS debug declarations + * + * Copyright (C) 2023 Red Hat Inc + * + * Authors: + * Konstantin Kostiuk + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include + +#ifndef VSS_DEBUG_H +#define VSS_DEBUG_H + +void qga_debug_internal(const char *funcname, const char *fmt, ...) G_GNUC= _PRINTF(2, 3); + +#define qga_debug(fmt, ...) qga_debug_internal(__func__, fmt, ## __VA_ARGS= __) +#define qga_debug_begin qga_debug("begin") +#define qga_debug_end qga_debug("end") + +#endif --=20 2.34.1 From nobody Mon Jun 24 12:22:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1688721842; cv=none; d=zohomail.com; s=zohoarc; b=P9nxDx5iruVRwfdF+vXBJ/eE1dLHTLvQ3FPTDEnevAWiAPqKlZ8JNkAeerONGUfEUcTTKkN2Xz6impdpi2Vqt+i/WFrwFYK08D/WtgQPzUnjg8350cf0QAl/uSjiVLMIplO6233L6e5Wa8ypl57tBQ6NUV6+hD9Wua62R9dA3qQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688721842; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Kkrnjko5KUnEbzwdNYhml0IdQEQUXs/nk3KJ7BvgXJY=; b=ijBJAEcBPdQNYr0PyaW6zTipKnE1vNPPUSUxWUv5avsilW0MkSx1Fl9aJ7VNVwct9rRhbNsFAdYte7VjoWNBEgfTEQFw9NEJn05gOjPGTlkWGXMLK8HJfDs2oLODUJeCMb2geMcYuMPIQZD4MRtYT5iBwUTQy4xZuHLUvSThZ/k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688721842105678.4541909196264; Fri, 7 Jul 2023 02:24:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHhgK-00077D-ES; Fri, 07 Jul 2023 05:23:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhgF-00076c-O6 for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:23:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhgE-0001K3-2b for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:23:11 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-42-dWghnOX9MU-CoFcoPiw_Dg-1; Fri, 07 Jul 2023 05:23:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 021A528088AE; Fri, 7 Jul 2023 09:23:05 +0000 (UTC) Received: from kostyanf14nb.redhat.com (unknown [10.45.225.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C871C4067A00; Fri, 7 Jul 2023 09:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688721789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kkrnjko5KUnEbzwdNYhml0IdQEQUXs/nk3KJ7BvgXJY=; b=SUQ1oYljJEjWAqdWRMfMpiRuzTVvPRVyHwkpKkTNLTQz9uexr3l1CuEI+TwvkujcKPdJQl 3E+VjKY2kYKNI+4uztAhBS6RpoKsiRyfNrn3xkZ6DGVoGzsiEHCOM4zbVoGff6xoYtJZpP leAYgZmx1783o5imXDfurFPmqjehjXc= X-MC-Unique: dWghnOX9MU-CoFcoPiw_Dg-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Roth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 2/4] QGA VSS: Replace 'fprintf(stderr' with PRINT_DEBUG Date: Fri, 7 Jul 2023 12:22:56 +0300 Message-Id: <20230707092258.768420-3-kkostiuk@redhat.com> In-Reply-To: <20230707092258.768420-1-kkostiuk@redhat.com> References: <20230707092258.768420-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1688721843174100006 Content-Type: text/plain; charset="utf-8" Signed-off-by: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- qga/vss-win32/install.cpp | 12 ++++++------ qga/vss-win32/requester.cpp | 9 +++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index ff93b08a9e..9bd2c52b70 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -13,6 +13,7 @@ #include "qemu/osdep.h" =20 #include "vss-common.h" +#include "vss-debug.h" #ifdef HAVE_VSS_SDK #include #else @@ -54,7 +55,7 @@ void errmsg(DWORD err, const char *text) FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSER= TS, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char *)&msg, 0, NULL); - fprintf(stderr, "%.*s. (Error: %lx) %s\n", len, text, err, msg); + qga_debug("%.*s. (Error: %lx) %s\n", len, text, err, msg); LocalFree(msg); } =20 @@ -219,7 +220,7 @@ static HRESULT QGAProviderRemove(ICatalogCollection *co= ll, int i, void *arg) { HRESULT hr; =20 - fprintf(stderr, "Removing COM+ Application: %s\n", QGA_PROVIDER_NAME); + qga_debug("Removing COM+ Application: %s", QGA_PROVIDER_NAME); chk(coll->Remove(i)); out: return hr; @@ -304,9 +305,8 @@ STDAPI COMRegister(void) } strcpy(tlbPath, dllPath); strcpy(tlbPath+n-3, "tlb"); - fprintf(stderr, "Registering " QGA_PROVIDER_NAME ":\n"); - fprintf(stderr, " %s\n", dllPath); - fprintf(stderr, " %s\n", tlbPath); + qga_debug("Registering " QGA_PROVIDER_NAME ": %s %s", + dllPath, tlbPath); if (!PathFileExists(tlbPath)) { hr =3D HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); errmsg(hr, "Failed to lookup tlb"); @@ -517,7 +517,7 @@ namespace _com_util } =20 if (mbstowcs(bstr, ascii, len) =3D=3D (size_t)-1) { - fprintf(stderr, "Failed to convert string '%s' into BSTR", asc= ii); + qga_debug("Failed to convert string '%s' into BSTR", ascii); bstr[0] =3D 0; } return bstr; diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp index 3e998af4a8..e85b9bc633 100644 --- a/qga/vss-win32/requester.cpp +++ b/qga/vss-win32/requester.cpp @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "vss-common.h" +#include "vss-debug.h" #include "requester.h" #include "install.h" #include @@ -59,13 +60,13 @@ STDAPI requester_init(void) NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_IMP_LEVEL_IDENTIFY, NULL, EOAC_NONE, NULL); if (FAILED(hr)) { - fprintf(stderr, "failed to CoInitializeSecurity (error %lx)\n", hr= ); + qga_debug("failed to CoInitializeSecurity (error %lx)", hr); return hr; } =20 hLib =3D LoadLibraryA("VSSAPI.DLL"); if (!hLib) { - fprintf(stderr, "failed to load VSSAPI.DLL\n"); + qga_debug("failed to load VSSAPI.DLL"); return HRESULT_FROM_WIN32(GetLastError()); } =20 @@ -78,14 +79,14 @@ STDAPI requester_init(void) #endif ); if (!pCreateVssBackupComponents) { - fprintf(stderr, "failed to get proc address from VSSAPI.DLL\n"); + qga_debug("failed to get proc address from VSSAPI.DLL"); return HRESULT_FROM_WIN32(GetLastError()); } =20 pVssFreeSnapshotProperties =3D (t_VssFreeSnapshotProperties) GetProcAddress(hLib, "VssFreeSnapshotProperties"); if (!pVssFreeSnapshotProperties) { - fprintf(stderr, "failed to get proc address from VSSAPI.DLL\n"); + qga_debug("failed to get proc address from VSSAPI.DLL"); return HRESULT_FROM_WIN32(GetLastError()); } =20 --=20 2.34.1 From nobody Mon Jun 24 12:22:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1688721842; cv=none; d=zohomail.com; s=zohoarc; b=ghEVjBySdcp54McXibN0X1OnJUtIzcXrtLtgZ41xeIR2nus2vMrmaaKtNNojR7GZO0exSr++h4Q56Gn5QEVk4lqMOMkGSfst9XPjnyoHxGB3TK5kdwvssq1fwitHigC64hFE85q054wRXhlZ9cz0lxsHcyyUP/bsQS0A6m5IG2I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688721842; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uQeL/qvwvB/1XthGE7D4je03jB+vFnLXBCCrTaW7rlo=; b=DCfMkIOd2BIDklEDPo3slOZ1+wR1Zdn9UXu6oJQCQSi/Q/s1wJpFZbBtIXDY4fuGsKXf8tr4VDEaj3r3oRfUvA9CW3rmzATC7B6r05F6khp7bda6qBme3vcpw+vAHsaPwDMAvtKDAnpBe1TblOZZl8z6AbzExumq8N7xKUdaNJA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688721842104438.8085310176865; Fri, 7 Jul 2023 02:24:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHhgN-000782-74; Fri, 07 Jul 2023 05:23:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhgG-00076d-0h for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:23:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhgE-0001KG-He for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:23:11 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-320-rSP4nihOO2-KE61Taa3M0A-1; Fri, 07 Jul 2023 05:23:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6B0A63C10144; Fri, 7 Jul 2023 09:23:06 +0000 (UTC) Received: from kostyanf14nb.redhat.com (unknown [10.45.225.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5753F4067A00; Fri, 7 Jul 2023 09:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688721790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uQeL/qvwvB/1XthGE7D4je03jB+vFnLXBCCrTaW7rlo=; b=gjMyLNSwV4znASEdmloD49YDZMNoQMSxoYzXQYkec9QlKvxoswJIorP61d++lsOvPH5Fwk T2qFgOh8YkQa59VaNceUiQIXfDeJqnHgxC6v8cyL9gFehMhV0YRKZKcGhcOB24kaYjAfr5 nvO6As/ViMhw2pl9YWHK1SJHb5FDgo4= X-MC-Unique: rSP4nihOO2-KE61Taa3M0A-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Roth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 3/4] QGA VSS: Print error in err_set Date: Fri, 7 Jul 2023 12:22:57 +0300 Message-Id: <20230707092258.768420-4-kkostiuk@redhat.com> In-Reply-To: <20230707092258.768420-1-kkostiuk@redhat.com> References: <20230707092258.768420-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1688721843410100010 Signed-off-by: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 @@ =20 #define DEFAULT_VSS_BACKUP_TYPE VSS_BT_FULL =20 -#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 !=3D NULL: */ #define err_is_set(e) ((e)->errp && *(e)->errp) /* To lift this restriction, error_propagate(), like we do in QEMU code */ --=20 2.34.1 From nobody Mon Jun 24 12:22:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1688721842; cv=none; d=zohomail.com; s=zohoarc; b=MnTctH1iEgefBkijwBFZMkqt1icyAMgIIMtoolD5igxGu3tp6Zdso6aCcAN7r0jPxCoK70Tbj73kbXztu4p2cBkooPDloc/YdZSSKtF2qd4NfbGG7AHdMYRtA3/380IImCRpdoZRWUXsRG7h+erhP3jG3hF2WnLSMlm3gh8ytg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688721842; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OO+o+a37PP66k1jdVxoprix7n0gXr/Z8ptkEq4BJeUg=; b=N/mVH6bximsTtnE2tRO4Nh48fsb6cFkZJ2xkZgABBE3S7hiDN+0XY4j6seczz1LEmVI3TFmgvKL4v9OCyj0/pe4bC/ye/9EzKClceePxNeE9JrZUGqE9z2valxGbS2GilqIgnaiT668NBK91Iwh+RpPMTavqppxANpvceFtDfGg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688721842073545.1762103635155; Fri, 7 Jul 2023 02:24:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHhgN-000783-7r; Fri, 07 Jul 2023 05:23:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhgI-000772-Bz for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:23:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHhgE-0001K7-MD for qemu-devel@nongnu.org; Fri, 07 Jul 2023 05:23:13 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-665-MMbzCcRjNHO8t_A3X39HJA-1; Fri, 07 Jul 2023 05:23:08 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2BB7285A58A; Fri, 7 Jul 2023 09:23:08 +0000 (UTC) Received: from kostyanf14nb.redhat.com (unknown [10.45.225.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C106D4067A00; Fri, 7 Jul 2023 09:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688721789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OO+o+a37PP66k1jdVxoprix7n0gXr/Z8ptkEq4BJeUg=; b=glaMir8RroTy0g2nr870g43rDjxrGT3NXBRSnwIAc23u08dBuuvqq3PhpTdWVyR9kqHve3 U+WzL1SgMYqLgmbWQ8PNdFD/YLymJdpPfmt5uxUX48h+BXerQ90k9oiG9Nu0dY7OPow/Xl NbxDNsf5fUEzI2zwh4yGhgvwpCpwxoI= X-MC-Unique: MMbzCcRjNHO8t_A3X39HJA-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Roth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/4] QGA VSS: Add log in functions begin/end Date: Fri, 7 Jul 2023 12:22:58 +0300 Message-Id: <20230707092258.768420-5-kkostiuk@redhat.com> In-Reply-To: <20230707092258.768420-1-kkostiuk@redhat.com> References: <20230707092258.768420-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1688721843456100012 Content-Type: text/plain; charset="utf-8" Signed-off-by: Konstantin Kostiuk --- qga/vss-win32/install.cpp | 33 +++++++++++++++++++++++++++++++++ qga/vss-win32/provider.cpp | 3 +++ qga/vss-win32/requester.cpp | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index 9bd2c52b70..6865c04d8a 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -100,6 +100,8 @@ HRESULT put_Value(ICatalogObject *pObj, LPCWSTR name, T= val) /* Lookup Administrators group name from winmgmt */ static HRESULT GetAdminName(_bstr_t *name) { + qga_debug_begin; + HRESULT hr; COMPointer pLoc; COMPointer pSvc; @@ -142,6 +144,7 @@ static HRESULT GetAdminName(_bstr_t *name) } =20 out: + qga_debug_end; return hr; } =20 @@ -149,6 +152,8 @@ out: static HRESULT getNameByStringSID( const wchar_t *sid, LPWSTR buffer, LPDWORD bufferLen) { + qga_debug_begin; + HRESULT hr =3D S_OK; PSID psid =3D NULL; SID_NAME_USE groupType; @@ -168,6 +173,7 @@ static HRESULT getNameByStringSID( LocalFree(psid); =20 out: + qga_debug_end; return hr; } =20 @@ -175,6 +181,8 @@ out: static HRESULT QGAProviderFind( HRESULT (*found)(ICatalogCollection *, int, void *), void *arg) { + qga_debug_begin; + HRESULT hr; COMInitializer initializer; COMPointer pUnknown; @@ -205,12 +213,15 @@ static HRESULT QGAProviderFind( chk(pColl->SaveChanges(&n)); =20 out: + qga_debug_end; return hr; } =20 /* Count QGA VSS provider in COM+ Application Catalog */ static HRESULT QGAProviderCount(ICatalogCollection *coll, int i, void *arg) { + qga_debug_begin; + (*(int *)arg)++; return S_OK; } @@ -218,28 +229,35 @@ static HRESULT QGAProviderCount(ICatalogCollection *c= oll, int i, void *arg) /* Remove QGA VSS provider from COM+ Application Catalog Collection */ static HRESULT QGAProviderRemove(ICatalogCollection *coll, int i, void *ar= g) { + qga_debug_begin; HRESULT hr; =20 qga_debug("Removing COM+ Application: %s", QGA_PROVIDER_NAME); chk(coll->Remove(i)); out: + qga_debug_end; return hr; } =20 /* Unregister this module from COM+ Applications Catalog */ STDAPI COMUnregister(void) { + qga_debug_begin; + HRESULT hr; =20 DllUnregisterServer(); chk(QGAProviderFind(QGAProviderRemove, NULL)); out: + qga_debug_end; return hr; } =20 /* Register this module to COM+ Applications Catalog */ STDAPI COMRegister(void) { + qga_debug_begin; + HRESULT hr; COMInitializer initializer; COMPointer pUnknown; @@ -259,12 +277,14 @@ STDAPI COMRegister(void) =20 if (!g_hinstDll) { errmsg(E_FAIL, "Failed to initialize DLL"); + qga_debug_end; return E_FAIL; } =20 chk(QGAProviderFind(QGAProviderCount, (void *)&count)); if (count) { errmsg(E_ABORT, "QGA VSS Provider is already installed"); + qga_debug_end; return E_ABORT; } =20 @@ -354,6 +374,7 @@ out: COMUnregister(); } =20 + qga_debug_end; return hr; } =20 @@ -369,6 +390,8 @@ STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE= , LPSTR, int) =20 static BOOL CreateRegistryKey(LPCTSTR key, LPCTSTR value, LPCTSTR data) { + qga_debug_begin; + HKEY hKey; LONG ret; DWORD size; @@ -389,6 +412,7 @@ static BOOL CreateRegistryKey(LPCTSTR key, LPCTSTR valu= e, LPCTSTR data) RegCloseKey(hKey); =20 out: + qga_debug_end; if (ret !=3D ERROR_SUCCESS) { /* As we cannot printf within DllRegisterServer(), show a dialog. = */ errmsg_dialog(ret, "Cannot add registry", key); @@ -400,6 +424,8 @@ out: /* Register this dll as a VSS provider */ STDAPI DllRegisterServer(void) { + qga_debug_begin; + COMInitializer initializer; COMPointer pVssAdmin; HRESULT hr =3D E_FAIL; @@ -478,12 +504,15 @@ out: DllUnregisterServer(); } =20 + qga_debug_end; return hr; } =20 /* Unregister this VSS hardware provider from the system */ STDAPI DllUnregisterServer(void) { + qga_debug_begin; + TCHAR key[256]; COMInitializer initializer; COMPointer pVssAdmin; @@ -501,6 +530,7 @@ STDAPI DllUnregisterServer(void) SHDeleteKey(HKEY_CLASSES_ROOT, key); SHDeleteKey(HKEY_CLASSES_ROOT, g_szProgid); =20 + qga_debug_end; return S_OK; /* Uninstall should never fail */ } =20 @@ -527,6 +557,8 @@ namespace _com_util /* Stop QGA VSS provider service using Winsvc API */ STDAPI StopService(void) { + qga_debug_begin; + HRESULT hr =3D S_OK; SC_HANDLE manager =3D OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); SC_HANDLE service =3D NULL; @@ -551,5 +583,6 @@ STDAPI StopService(void) out: CloseServiceHandle(service); CloseServiceHandle(manager); + qga_debug_end; return hr; } diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp index 1b885e24ee..cc72e5ef1b 100644 --- a/qga/vss-win32/provider.cpp +++ b/qga/vss-win32/provider.cpp @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "vss-common.h" +#include "vss-debug.h" #ifdef HAVE_VSS_SDK #include #else @@ -529,9 +530,11 @@ STDAPI DllCanUnloadNow() EXTERN_C BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved) { + qga_debug("begin, reason =3D %lu", dwReason); if (dwReason =3D=3D DLL_PROCESS_ATTACH) { g_hinstDll =3D hinstDll; DisableThreadLibraryCalls(hinstDll); } + qga_debug_end; return TRUE; } diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp index f3eafacfc1..9884c65e70 100644 --- a/qga/vss-win32/requester.cpp +++ b/qga/vss-win32/requester.cpp @@ -57,6 +57,8 @@ static struct QGAVSSContext { =20 STDAPI requester_init(void) { + qga_debug_begin; + COMInitializer initializer; /* to call CoInitializeSecurity */ HRESULT hr =3D CoInitializeSecurity( NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, @@ -92,11 +94,14 @@ STDAPI requester_init(void) return HRESULT_FROM_WIN32(GetLastError()); } =20 + qga_debug_end; return S_OK; } =20 static void requester_cleanup(void) { + qga_debug_begin; + if (vss_ctx.hEventFrozen) { CloseHandle(vss_ctx.hEventFrozen); vss_ctx.hEventFrozen =3D NULL; @@ -118,10 +123,13 @@ static void requester_cleanup(void) vss_ctx.pVssbc =3D NULL; } vss_ctx.cFrozenVols =3D 0; + qga_debug_end; } =20 STDAPI requester_deinit(void) { + qga_debug_begin; + requester_cleanup(); =20 pCreateVssBackupComponents =3D NULL; @@ -131,11 +139,14 @@ STDAPI requester_deinit(void) hLib =3D NULL; } =20 + qga_debug_end; return S_OK; } =20 static HRESULT WaitForAsync(IVssAsync *pAsync) { + qga_debug_begin; + HRESULT ret, hr; =20 do { @@ -151,11 +162,14 @@ static HRESULT WaitForAsync(IVssAsync *pAsync) } } while (ret =3D=3D VSS_S_ASYNC_PENDING); =20 + qga_debug_end; return ret; } =20 static void AddComponents(ErrorSet *errset) { + qga_debug_begin; + unsigned int cWriters, i; VSS_ID id, idInstance, idWriter; BSTR bstrWriterName =3D NULL; @@ -237,17 +251,21 @@ out: if (pComponent && info) { pComponent->FreeComponentInfo(info); } + qga_debug_end; } =20 DWORD get_reg_dword_value(HKEY baseKey, LPCSTR subKey, LPCSTR valueName, DWORD defaultData) { + qga_debug_begin; + DWORD regGetValueError; DWORD dwordData; DWORD dataSize =3D sizeof(DWORD); =20 regGetValueError =3D RegGetValue(baseKey, subKey, valueName, RRF_RT_DW= ORD, NULL, &dwordData, &dataSize); + qga_debug_end; if (regGetValueError !=3D ERROR_SUCCESS) { return defaultData; } @@ -262,6 +280,8 @@ bool is_valid_vss_backup_type(VSS_BACKUP_TYPE vssBT) VSS_BACKUP_TYPE get_vss_backup_type( VSS_BACKUP_TYPE defaultVssBT =3D DEFAULT_VSS_BACKUP_TYPE) { + qga_debug_begin; + VSS_BACKUP_TYPE vssBackupType; =20 vssBackupType =3D static_cast( @@ -269,6 +289,7 @@ VSS_BACKUP_TYPE get_vss_backup_type( QGA_PROVIDER_REGISTRY_ADDR= ESS, "VssOption", defaultVssBT)); + qga_debug_end; if (!is_valid_vss_backup_type(vssBackupType)) { return defaultVssBT; } @@ -277,6 +298,8 @@ VSS_BACKUP_TYPE get_vss_backup_type( =20 void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset) { + qga_debug_begin; + COMPointer pAsync; HANDLE volume; HRESULT hr; @@ -292,6 +315,7 @@ void requester_freeze(int *num_vols, void *mountpoints,= ErrorSet *errset) =20 if (vss_ctx.pVssbc) { /* already frozen */ *num_vols =3D 0; + qga_debug("finished, already frozen"); return; } =20 @@ -449,6 +473,7 @@ void requester_freeze(int *num_vols, void *mountpoints,= ErrorSet *errset) } } =20 + qga_debug("preparing for backup"); hr =3D vss_ctx.pVssbc->PrepareForBackup(pAsync.replace()); if (SUCCEEDED(hr)) { hr =3D WaitForAsync(pAsync); @@ -472,6 +497,7 @@ void requester_freeze(int *num_vols, void *mountpoints,= ErrorSet *errset) * CQGAVssProvider::CommitSnapshots will kick vss_ctx.hEventFrozen * after the applications and filesystems are frozen. */ + qga_debug("do snapshot set"); hr =3D vss_ctx.pVssbc->DoSnapshotSet(&vss_ctx.pAsyncSnapshot); if (FAILED(hr)) { err_set(errset, hr, "failed to do snapshot set"); @@ -518,6 +544,7 @@ void requester_freeze(int *num_vols, void *mountpoints,= ErrorSet *errset) *num_vols =3D vss_ctx.cFrozenVols =3D num_fixed_drives; } =20 + qga_debug("end successful"); return; =20 out: @@ -528,11 +555,14 @@ out: out1: requester_cleanup(); CoUninitialize(); + + qga_debug_end; } =20 =20 void requester_thaw(int *num_vols, void *mountpints, ErrorSet *errset) { + qga_debug_begin; COMPointer pAsync; =20 if (!vss_ctx.hEventThaw) { @@ -541,6 +571,8 @@ void requester_thaw(int *num_vols, void *mountpints, Er= rorSet *errset) * and no volumes must be frozen. We return without an error. */ *num_vols =3D 0; + qga_debug("finished, no volumes were frozen"); + return; } =20 @@ -597,4 +629,6 @@ void requester_thaw(int *num_vols, void *mountpints, Er= rorSet *errset) =20 CoUninitialize(); StopService(); + + qga_debug_end; } --=20 2.34.1