summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorSimon Rettberg2017-11-02 13:41:35 +0100
committerSimon Rettberg2017-11-02 13:41:35 +0100
commit1587f73c38c9228a1a93889aae6351eff891cbe8 (patch)
tree4a43804793d1c5c3a1d0566c827e7cde8bac3c6b /src/shared
parent[FUSE] Fix printf warning for logadd call (diff)
downloaddnbd3-1587f73c38c9228a1a93889aae6351eff891cbe8.tar.gz
dnbd3-1587f73c38c9228a1a93889aae6351eff891cbe8.tar.xz
dnbd3-1587f73c38c9228a1a93889aae6351eff891cbe8.zip
[SERVER] Support finer control over replication when a proxy connects to a proxy
Introduce new flag in "select image" message to tell the uplink server whether we have background replication enabled or not. Also reject a connecting proxy if the connecting proxy uses BGR but we don't, as this would basically force the image to be replicated locally too.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/protocol.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shared/protocol.h b/src/shared/protocol.h
index 561e5a1..1665e70 100644
--- a/src/shared/protocol.h
+++ b/src/shared/protocol.h
@@ -11,11 +11,17 @@
#include <sys/socket.h>
#include <sys/uio.h>
+// Client tells server that it is another server
#define FLAGS8_SERVER (1)
+// Client (which is a proxy) tells server that it has background-replication enabled
+#define FLAGS8_BG_REP (2)
// 2017-10-16: We now support hop-counting, macro to pass hop count conditinally to a function
#define COND_HOPCOUNT(vers,hopcount) ( (vers) >= 3 ? (hopcount) : 0 )
+// 2017-11-02: Macro to set flags in select image message properly if we're a server, as BG_REP depends on global var
+#define SI_SERVER_FLAGS ( FLAGS8_SERVER | (_backgroundReplication ? FLAGS8_BG_REP : 0) )
+
#define REPLY_OK (0)
#define REPLY_ERRNO (-1)
#define REPLY_AGAIN (-2)