]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Hgfs Server: Fix snapshot synchronization callback
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:43 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:43 +0000 (11:23 -0700)
Currently when snapshots occur, the VMX calls the HGFS server
manager synchronization callback to notify the Hgfs server to
freeze or thaw the Hgfs file IO activity.  First, this Hgfs
server synchronization callback is called regardless of the
Hgfs Shared folders feature and server is enabled or not.
Consequently, the Hgfs server callback lamely uses a global
variable to track the server state just for this call and
returns without doing anything if not initialized.
Second, the HGFS server now requires the transport connection
in order to extract the Hgfs session as the file notification
component requires the session to allow its event generating
thread to callback to the server to register and unregister
through the transport which uses the PhysMem APIs.

This change fixes:
- call the Hgfs server only if Shared Folders and the server
  are enabled
- call through the channel manager and channel transport to
  the Hgfs server
- Hgfs server session callback table is extehded with a server
  quiesce callback.
- HgfsServerSessionQuiesce callback now replaces the old
  HgfsServer_Quiesce exported API.
- Make the quiesce callback use an enum to the thaw-freeze op
  instead of a bool
- remove the Hgfs server initialized global now it is not required

The tools implementation of the Hgfs server code does not use this
API and thus the guest Hgfs manager and transport channel do not
implement any code which will use the session quiesce callback.

open-vm-tools/lib/include/hgfsServer.h

index 5fca4596223d4521f43d4df8d9e388a407056c4f..68f6c975b101ca0147461354e6c6c2fefe902cce 100644 (file)
@@ -161,6 +161,11 @@ typedef struct HgfsServerMgrCallbacks {
    HgfsServerResEnumCallbacks enumResources;
 } HgfsServerMgrCallbacks;
 
+typedef enum {
+   HGFS_QUIESCE_FREEZE,
+   HGFS_QUIESCE_THAW,
+} HgfsQuiesceOp;
+
 /*
  * Function used for invalidating nodes and searches that fall outside of a
  * share when the list of shares changes.
@@ -192,6 +197,7 @@ typedef struct HgfsServerSessionCallbacks {
    void (*invalidateObjects)(void *, DblLnkLst_Links *);
    uint32 (*invalidateInactiveSessions)(void *);
    void (*sendComplete)(HgfsPacket *, void *);
+   void (*quiesce)(void *, HgfsQuiesceOp);
 } HgfsServerSessionCallbacks;
 
 /* XXX: TODO delete this layer if no other non-session callbacks are required. */