]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add NVMe capability for vmbackup.
authorJohn Wolfe <jwolfe@vmware.com>
Thu, 4 Feb 2021 17:57:03 +0000 (09:57 -0800)
committerJohn Wolfe <jwolfe@vmware.com>
Thu, 4 Feb 2021 17:57:03 +0000 (09:57 -0800)
The vmx/vmbackup logic checks if tools/vmbackup can support NVMe.  If it
is supported, vmx/vmbackup can further go through the app quiesce process.
Otherwise, vmx/vmbackup requests the filesystem quiesce process.

open-vm-tools/lib/include/vmware/guestrpc/capabilities.h
open-vm-tools/services/plugins/vmbackup/stateMachine.c

index 93848accf7537142e230db62ebede81c956fc59c..547b051ebaddd998e5f048e9c1e79d35635fc1b9 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2008-2017,2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2017,2020-2021 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
@@ -78,6 +78,7 @@ typedef enum {
    UNITY_CAP_CARET_POSITION             = 33, // supports sending caret position updates
    CAP_GUESTSTORE_UPGRADE               = 34, // supports tools upgrade from GuestStore
    CAP_DEVICE_HELPER                    = 35, // supports tools device helper for Windows guests
+   CAP_VMBACKUP_NVME                    = 36, // supports NVMe for vmbackup
 } GuestCapabilities;
 
 typedef struct {
@@ -143,6 +144,7 @@ static GuestCapElem guestCapTable[] = {
     */
    { CAP_GUESTSTORE_UPGRADE,               NULL,                NULL },
    { CAP_DEVICE_HELPER,                    NULL,                NULL },
+   { CAP_VMBACKUP_NVME,                    NULL,                NULL },
 };
 // clang-format on
 
index c0ecbfd0c93ce49304de1d5d996f1c6d2e658cfe..e426dcf5ba98b724de1ac8c4fdc74115052282cb 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2007-2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2007-2021 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
@@ -1440,6 +1440,38 @@ VmBackupShutdown(gpointer src,
 }
 
 
+/*
+ *******************************************************************************
+ * VmBackupCapabilities --                                               */ /**
+ *
+ * Sends the vmbackup capability to the VMX.
+ *
+ * @param[in]  src      The source object.
+ * @param[in]  ctx      The app context.
+ * @param[in]  set      Whether setting or unsetting the capability.
+ * @param[in]  data     Unused.
+ *
+ * @return An array with the capabilities to set.
+ *
+ *******************************************************************************
+ */
+
+static GArray *
+VmBackupCapabilities(gpointer src,
+                     ToolsAppCtx *ctx,
+                     gboolean set,
+                     gpointer data)
+{
+   ToolsAppCapability caps[] = {
+      { TOOLS_CAP_NEW, NULL, CAP_VMBACKUP_NVME, },
+   };
+
+   caps[0].value = set ? 1 : 0;
+
+   return VMTools_WrapArray(caps, sizeof *caps, ARRAYSIZE(caps));
+}
+
+
 /**
  * Plugin entry point. Initializes internal plugin state.
  *
@@ -1469,6 +1501,7 @@ ToolsOnLoad(ToolsAppCtx *ctx)
       { VMBACKUP_PROTOCOL_SNAPSHOT_DONE, VmBackupSnapshotDone, NULL, NULL, NULL, 0 }
    };
    ToolsPluginSignalCb sigs[] = {
+      { TOOLS_CORE_SIG_CAPABILITIES, VmBackupCapabilities, NULL },
       { TOOLS_CORE_SIG_DUMP_STATE, VmBackupDumpState, NULL },
       { TOOLS_CORE_SIG_RESET, VmBackupReset, NULL },
       { TOOLS_CORE_SIG_SHUTDOWN, VmBackupShutdown, NULL },