summaryrefslogtreecommitdiffstats
path: root/src/server/server.h
diff options
context:
space:
mode:
authorsr2012-08-31 22:30:52 +0200
committersr2012-08-31 22:30:52 +0200
commit51cc7103be13a9cb756d6a89d7e3306d4ef517ed (patch)
tree1ab6468b3ae4550a389b1b78d63bfece8975c036 /src/server/server.h
parentlast minute messup fixed (diff)
downloaddnbd3-51cc7103be13a9cb756d6a89d7e3306d4ef517ed.tar.gz
dnbd3-51cc7103be13a9cb756d6a89d7e3306d4ef517ed.tar.xz
dnbd3-51cc7103be13a9cb756d6a89d7e3306d4ef517ed.zip
[SERVER] Added soft and hard timeouts for image deletion: reject any new clients for an image where the soft timeout has been reached, kill all clients for an image where the hard timeout has been reached and remove it from the server. Check for the hard timeout every five minutes
[SERVER] Re-Implement image deletion to work with image names instead of vids [SERVER] Add helper functions to simplify dealing with libxml2
Diffstat (limited to 'src/server/server.h')
-rw-r--r--src/server/server.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/server.h b/src/server/server.h
index 875a5af..90aae5c 100644
--- a/src/server/server.h
+++ b/src/server/server.h
@@ -30,8 +30,8 @@
typedef struct
{
- char *name; // full name of image, eg. "uni-freiburg/rz/ubuntu-12.04"
- char *low_name; // full name of image, lowercased for comparison
+ char *config_group; // exact name of group in config file that represents this image
+ char *low_name; // full (global) name of image, lowercased for comparison, eg. "uni-freiburg/rz/ubuntu-12.04"
int rid; // revision of provided image
char *file; // path to image file or device
uint64_t filesize; // size of image
@@ -40,6 +40,8 @@ typedef struct
uint8_t *cache_map; // cache map telling which parts are locally cached
char *cache_file; // path to local cache of image (in case the image is read from a dnbd3 device)
char working; // whether this image is considered working. local images are "working" if the local file exists, proxied images have to have at least one working upstream server or a complete local cache file
+ time_t delete_soft; // unixtime telling when this image should be deleted. if there are still clients using this image it weill be kept, but new clients requesting the image will be rejected. 0 = never
+ time_t delete_hard; // unixtime telling when this image should be deleted, no matter if there are still clients connected. 0 = never
} dnbd3_image_t;
typedef struct
@@ -53,7 +55,7 @@ typedef struct
extern GSList *_dnbd3_clients; // of dnbd3_client_t
extern pthread_spinlock_t _spinlock;
-extern char *_config_file_name, *_local_namespace;
+extern char *_config_file_name, *_local_namespace, *_ipc_password;
extern GSList *_dnbd3_images; // of dnbd3_image_t