* Sends a command to the VMX asking it to update VMDB about a new backup event.
* This will restart the keep-alive timer.
*
+ * As the name implies, does not abort the quiesce operation on failure.
+ *
* @param[in] event The event to set.
* @param[in] code Error code.
- * @param[in] dest Error description.
+ * @param[in] desc Error description.
*
* @return TRUE on success.
*/
Bool
-VmBackup_SendEvent(const char *event,
- const uint32 code,
- const char *desc)
+VmBackup_SendEventNoAbort(const char *event,
+ const uint32 code,
+ const char *desc)
{
Bool success;
char *result = NULL;
} else {
g_warning("Failed to send vmbackup event: %s, result: %s.\n",
msg, result);
- if (gBackupState->rpcState != VMBACKUP_RPC_STATE_IGNORE) {
- g_debug("Changing rpcState from %d to %d\n",
- gBackupState->rpcState, VMBACKUP_RPC_STATE_ERROR);
- gBackupState->rpcState = VMBACKUP_RPC_STATE_ERROR;
- }
}
vm_free(result);
g_free(msg);
}
+/**
+ * Sends a command to the VMX asking it to update VMDB about a new backup event.
+ * This will restart the keep-alive timer.
+ *
+ * Aborts the quiesce operation on RPC failure.
+ *
+ * @param[in] event The event to set.
+ * @param[in] code Error code.
+ * @param[in] desc Error description.
+ *
+ * @return TRUE on success.
+ */
+
+Bool
+VmBackup_SendEvent(const char *event,
+ const uint32 code,
+ const char *desc)
+{
+ Bool success = VmBackup_SendEventNoAbort(event, code, desc);
+
+ if (!success && gBackupState->rpcState != VMBACKUP_RPC_STATE_IGNORE) {
+ g_debug("Changing rpcState from %d to %d\n",
+ gBackupState->rpcState, VMBACKUP_RPC_STATE_ERROR);
+ gBackupState->rpcState = VMBACKUP_RPC_STATE_ERROR;
+ }
+
+ return success;
+}
+
+
/**
* Cleans up the backup state object and sends a "done" event to the VMX.
*/
/**
- * Reset callback.
+ * Reset callback. Currently does nothing.
*
* @param[in] src The source object. Unused.
* @param[in] ctx Unused.
ToolsAppCtx *ctx,
gpointer data)
{
- VmBackup_SyncDriverReset();
+
}
}
#endif
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * VmBackup_SyncDriverReset --
- *
- * Reset function
- *
- * Results:
- * None.
- *
- * Side effects:
- * Whatever are the side effects of what it calls.
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-VmBackup_SyncDriverReset(void)
-{
- SyncManifestReset();
-}
/*********************************************************
- * Copyright (C) 2017-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 2017-2019 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);
return FALSE;
}
- if (!VmBackup_SendEvent(VMBACKUP_EVENT_GENERIC_MANIFEST,
- VMBACKUP_SUCCESS, manifest->path)) {
- g_warning("Host doesn't appear to support backup manifests "
- "for Linux guests.\n");
- gSyncManifestTrySend = FALSE;
+ if (!VmBackup_SendEventNoAbort(VMBACKUP_EVENT_GENERIC_MANIFEST,
+ VMBACKUP_SUCCESS, manifest->path)) {
+ /* VmBackup_SendEventNoAbort logs the error */
+ g_info("Non-fatal error occurred while sending %s, continuing "
+ "with the operation", VMBACKUP_EVENT_GENERIC_MANIFEST);
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-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 2017-2019 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__) */
const uint32 code,
const char *desc);
-void
-VmBackup_SyncDriverReset(void);
+
+Bool
+VmBackup_SendEventNoAbort(const char *event,
+ const uint32 code,
+ const char *desc);
#endif /* _VMBACKUPINT_H_*/