]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Reduce quiesced snapshot warning messages when running on older hosts.
authorOliver Kurth <okurth@vmware.com>
Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)
committerOliver Kurth <okurth@vmware.com>
Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)
vSphere 6.7 added a new interface on the host side that allows tools
to send a "generic" backup manifest during a quiesced snapshot on
Linux guests. VMTools 10.2.0 or later will try to send the manifest
file and if the host is unable to field it, then VMTools logs this
information and continues with the quiesced snapshot in the older
fashion.  This change reduces the logging that is done in this case.

open-vm-tools/services/plugins/vmbackup/stateMachine.c
open-vm-tools/services/plugins/vmbackup/syncDriverOps.c
open-vm-tools/services/plugins/vmbackup/syncManifest.c
open-vm-tools/services/plugins/vmbackup/syncManifest.h
open-vm-tools/services/plugins/vmbackup/vmBackupInt.h

index 89a907ca5ec8286f2ae31af8b12de5ddbfac4829..ebeaf42b67f8e9e9b8c2ebeae80af30b9341e2a9 100644 (file)
@@ -1333,9 +1333,9 @@ VmBackupDumpState(gpointer src,
 
 
 /**
- * Reset callback. Currently does nothing.
+ * Reset callback.
  *
- * @param[in]  src      The source object.
+ * @param[in]  src      The source object.  Unused.
  * @param[in]  ctx      Unused.
  * @param[in]  data     Unused.
  */
@@ -1345,6 +1345,7 @@ VmBackupReset(gpointer src,
               ToolsAppCtx *ctx,
               gpointer data)
 {
+   VmBackup_SyncDriverReset();
 }
 
 
index 65994e7a718bcd696c780d2d75d378796f3bb197..9f5844439725d9de219c3e20b3b92380a32cf2ce 100644 (file)
@@ -642,3 +642,26 @@ VmBackup_NewSyncDriverOnlyProvider(void)
 }
 
 #endif
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * VmBackup_SyncDriverReset --
+ *
+ *    Reset function
+ *
+ * Results:
+ *    None.
+ *
+ * Side effects:
+ *    Whatever are the side effects of what it calls.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+VmBackup_SyncDriverReset(void)
+{
+   SyncManifestReset();
+}
index e63ae777ad94952b166967ba56ca49ddd0e49a5d..224f7e8aa7016323fcdeec30c450c83f3616cae2 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2017-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -49,6 +49,12 @@ static const char syncManifestFmt[] = {
  */
 static const char syncManifestSwitch[] = "enableXmlManifest";
 
+/*
+ * If TRUE, indicates that VMTools should try to generate the backup
+ * manifest and send it to VMX; if FALSE, it won't try to do so.
+ */
+static Bool gSyncManifestTrySend = TRUE;
+
 
 /*
  *-----------------------------------------------------------------------------
@@ -89,6 +95,12 @@ SyncNewManifest(VmBackupState *state,          // IN
       return NULL;
    }
 
+   if (!gSyncManifestTrySend) {
+      g_debug("No backup manifest generated since previous"
+              " attempt to send one to host failed.\n");
+      return NULL;
+   }
+
    manifest = g_new0(SyncManifest, 1);
    manifest->path = g_strdup_printf("%s/%s", state->configDir,
                                     syncManifestName);
@@ -163,9 +175,35 @@ SyncManifestSend(SyncManifest *manifest)       // IN
 
    if (!VmBackup_SendEvent(VMBACKUP_EVENT_GENERIC_MANIFEST,
                            VMBACKUP_SUCCESS, manifest->path)) {
-      g_warning("Error trying to send VMBACKUP_EVENT_GENERIC_MANIFEST.\n");
+      g_warning("Host doesn't appear to support backup manifests "
+                "for Linux guests.\n");
+      gSyncManifestTrySend = FALSE;
       return FALSE;
    }
 
+   g_debug("Backup manifest was sent successfully.\n");
    return TRUE;
 }
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * SyncManifestReset --
+ *
+ *    Reset SyncManifest global state
+ *
+ * Results:
+ *    None
+ *
+ * Side effects:
+ *    None
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+SyncManifestReset(void)
+{
+   gSyncManifestTrySend = TRUE;
+}
index 76966ccacf3c80f8699049ddb78206aebdc838aa..9e4e9eb3022653183cfdff9ece898e5cd230f3d3 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2017-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -45,6 +45,9 @@ SyncManifestSend(SyncManifest *manifest);
 void
 SyncManifestRelease(SyncManifest *manifest);
 
+void
+SyncManifestReset(void);
+
 #else /* !defined(__linux__) */
 
 typedef void SyncManifest;
@@ -52,6 +55,7 @@ typedef void SyncManifest;
 #define SyncNewManifest(s, h)            (NULL)
 #define SyncManifestSend(m)              (TRUE)
 #define SyncManifestRelease(m)           ASSERT(m == NULL)
+#define SyncManifestReset()
 
 #endif /* defined(__linux__) */
 
index 6a5bbcddc091926e82bd3095789084710b76467f..7b819ac154906f2db7556f95e09cd49f1e65d715 100644 (file)
@@ -295,5 +295,8 @@ VmBackup_SendEvent(const char *event,
                    const uint32 code,
                    const char *desc);
 
+void
+VmBackup_SyncDriverReset(void);
+
 #endif /* _VMBACKUPINT_H_*/