*/
static Bool
-VmBackupDriverThaw(VmBackupDriverOp *op)
+VmBackupDriverThaw(SyncDriverHandle *handle)
{
- Bool success = SyncDriver_Thaw(*op->syncHandle);
- SyncDriver_CloseHandle(op->syncHandle);
+ Bool success = SyncDriver_Thaw(*handle);
+ SyncDriver_CloseHandle(handle);
return success;
}
case SYNCDRIVER_IDLE:
if (op->canceled) {
- VmBackupDriverThaw(op);
+ VmBackupDriverThaw(op->syncHandle);
}
/*
* This prevents the release callback from freeing the handle, which
break;
default:
- VmBackupDriverThaw(op);
+ VmBackupDriverThaw(op->syncHandle);
ret = VMBACKUP_STATUS_ERROR;
break;
}
state->enableNullDriver : FALSE,
op->syncHandle);
} else {
- success = VmBackupDriverThaw(op);
+ success = VmBackupDriverThaw(op->syncHandle);
}
if (!success) {
g_warning("Error %s filesystems.", freeze ? "freezing" : "thawing");
static Bool
VmBackupSyncDriverReadyForSnapshot(VmBackupState *state)
{
- Bool success;
SyncDriverHandle *handle = state->clientData;
g_debug("*** %s\n", __FUNCTION__);
if (handle != NULL && *handle != SYNCDRIVER_INVALID_HANDLE) {
+ Bool success;
success = VmBackup_SendEvent(VMBACKUP_EVENT_SNAPSHOT_COMMIT, 0, "");
if (success) {
state->freezeStatus = VMBACKUP_FREEZE_FINISHED;
} else {
+ /*
+ * If the vmx does not know this event (e.g. due to an RPC timeout),
+ * then filesystems need to be thawed here because snapshotDone
+ * will not be sent by the vmx.
+ */
+ g_debug("VMX state changed; thawing filesystems.\n");
+ if (!VmBackupDriverThaw(handle)) {
+ g_warning("Error thawing filesystems.\n");
+ }
state->freezeStatus = VMBACKUP_FREEZE_ERROR;
}
return success;