From ef92307fd49e75482c7599caf68685afc1807512 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Fri, 6 Nov 2020 12:44:43 +0100 Subject: [KERNEL, CLIENT]: submit and probe multiple dnbd3-server with ioctl OPEN The ioctl OPEN call for DNBD3 devices exposed by the dnbd3 Linux kernel module, is extended with a fixed array of dnbd3 hosts. The fixed array allows the dnbd3-client to submit host information (IP address and port) of multiple dnbd3-servers. This information is used to probe all submitted dnbd3-servers and add them to the alternative dnbd3-server list. If at least one dnbd3-server is not reachable, the OPEN ioctl call will abort with an error code. --- inc/dnbd3/types.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/dnbd3/types.h b/inc/dnbd3/types.h index 63e182c..59bf2d1 100644 --- a/inc/dnbd3/types.h +++ b/inc/dnbd3/types.h @@ -128,10 +128,14 @@ typedef struct __attribute__((packed)) dnbd3_host_t dnbd3_af type; // 1byte (ip version. HOST_IP4 or HOST_IP6. 0 means this struct is empty and should be ignored) } dnbd3_host_t; +/* IOCTLs */ +#define MAX_HOSTS_PER_IOCTL NUMBER_SERVERS + typedef struct __attribute__((packed)) { uint16_t len; - dnbd3_host_t host; + dnbd3_host_t hosts[MAX_HOSTS_PER_IOCTL]; + uint8_t hosts_num; uint16_t imgnamelen; char *imgname; int rid; -- cgit v1.2.3-55-g7522