]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Disable NVMe quiesced snapshot by default.
authorJohn Wolfe <jwolfe@vmware.com>
Fri, 26 Mar 2021 03:21:18 +0000 (20:21 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Fri, 26 Mar 2021 03:21:18 +0000 (20:21 -0700)
Open-vm-tools has no FSS.  Enable the feature only when it has been
completely verified and FSS is enabled on the host side.

open-vm-tools/services/plugins/vmbackup/stateMachine.c

index e426dcf5ba98b724de1ac8c4fdc74115052282cb..03331e4b1a84ccd9b10ae1835b9df53aa475eb54 100644 (file)
@@ -91,6 +91,16 @@ VM_EMBED_VERSION(VMTOOLSD_VERSION_STRING);
    VMTools_ConfigGetInteger(config, "vmbackup", key, defVal)
 
 #define VMBACKUP_CFG_ENABLEVSS      "enableVSS"
+#define VMBACKUP_CFG_ENABLENVME     "enableNVMe"
+
+/**
+ * Default value for VMBACKUP_CFG_ENABLENVME setting in
+ * tools configuration file.
+ *
+ * TRUE will allow the host to use NVMe feature in snapshot,
+ * FALSE otherwise.
+ */
+#define VMBACKUP_CFG_ENABLENVME_DEFAULT                  FALSE
 
 static VmBackupState *gBackupState = NULL;
 
@@ -1465,8 +1475,14 @@ VmBackupCapabilities(gpointer src,
    ToolsAppCapability caps[] = {
       { TOOLS_CAP_NEW, NULL, CAP_VMBACKUP_NVME, },
    };
+   Bool enableNVMe = VMBACKUP_CONFIG_GET_BOOL(ctx->config,
+                                              VMBACKUP_CFG_ENABLENVME,
+                                              VMBACKUP_CFG_ENABLENVME_DEFAULT);
+
+   g_debug("%s - vmbackup NVMe feature is %s\n", __FUNCTION__,
+           enableNVMe ? "enabled" : "disabled");
 
-   caps[0].value = set ? 1 : 0;
+   caps[0].value =  enableNVMe && set ? 1 : 0;
 
    return VMTools_WrapArray(caps, sizeof *caps, ARRAYSIZE(caps));
 }