/*********************************************************
- * 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
*/
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;
+
/*
*-----------------------------------------------------------------------------
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);
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;
+}
/*********************************************************
- * 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
void
SyncManifestRelease(SyncManifest *manifest);
+void
+SyncManifestReset(void);
+
#else /* !defined(__linux__) */
typedef void SyncManifest;
#define SyncNewManifest(s, h) (NULL)
#define SyncManifestSend(m) (TRUE)
#define SyncManifestRelease(m) ASSERT(m == NULL)
+#define SyncManifestReset()
#endif /* defined(__linux__) */