From: John Wolfe Date: Thu, 4 Feb 2021 17:57:03 +0000 (-0800) Subject: Add NVMe capability for vmbackup. X-Git-Tag: stable-11.3.0~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7ddf98958097197468cd153227317cba205a19c;p=thirdparty%2Fopen-vm-tools.git Add NVMe capability for vmbackup. 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. --- diff --git a/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h b/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h index 93848accf..547b051eb 100644 --- a/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h +++ b/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h @@ -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 diff --git a/open-vm-tools/services/plugins/vmbackup/stateMachine.c b/open-vm-tools/services/plugins/vmbackup/stateMachine.c index c0ecbfd0c..e426dcf5b 100644 --- a/open-vm-tools/services/plugins/vmbackup/stateMachine.c +++ b/open-vm-tools/services/plugins/vmbackup/stateMachine.c @@ -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 },