mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-09 13:53:58 +00:00
[client/host] share the host version with the client for diagnostics
This commit is contained in:
parent
667ab981ba
commit
553e2830bb
4 changed files with 17 additions and 9 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
B2-rc2-1-gbc7871f630+1
|
B2-rc2-2-g667ab981ba+1
|
|
@ -1474,19 +1474,25 @@ static int lg_run()
|
||||||
if (!state.running)
|
if (!state.running)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (udataSize != sizeof(KVMFR) ||
|
const bool magicMatches = memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) == 0;
|
||||||
memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 ||
|
if (udataSize != sizeof(KVMFR) || !magicMatches || udata->version != KVMFR_VERSION)
|
||||||
udata->version != KVMFR_VERSION)
|
|
||||||
{
|
{
|
||||||
DEBUG_BREAK();
|
DEBUG_BREAK();
|
||||||
DEBUG_ERROR("The host application is not compatible with this client");
|
DEBUG_ERROR("The host application is not compatible with this client");
|
||||||
DEBUG_ERROR("Expected KVMFR version %d", KVMFR_VERSION);
|
|
||||||
DEBUG_ERROR("This is not a Looking Glass error, do not report this");
|
DEBUG_ERROR("This is not a Looking Glass error, do not report this");
|
||||||
|
DEBUG_ERROR("Please install the matching host application for this client");
|
||||||
|
|
||||||
|
if (magicMatches)
|
||||||
|
DEBUG_ERROR("Expected KVMFR version %d, got %d", KVMFR_VERSION, udata->version);
|
||||||
|
else
|
||||||
|
DEBUG_ERROR("Invalid KVMFR magic");
|
||||||
|
|
||||||
DEBUG_BREAK();
|
DEBUG_BREAK();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_INFO("Host ready, starting session");
|
DEBUG_INFO("Host ready, reported version: %s", udata->hostver);
|
||||||
|
DEBUG_INFO("Starting session");
|
||||||
|
|
||||||
if (!lgCreateThread("cursorThread", cursorThread, NULL, &t_cursor))
|
if (!lgCreateThread("cursorThread", cursorThread, NULL, &t_cursor))
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,12 +51,13 @@ typedef enum CursorType
|
||||||
CursorType;
|
CursorType;
|
||||||
|
|
||||||
#define KVMFR_MAGIC "KVMFR---"
|
#define KVMFR_MAGIC "KVMFR---"
|
||||||
#define KVMFR_VERSION 1
|
#define KVMFR_VERSION 2
|
||||||
|
|
||||||
typedef struct KVMFR
|
typedef struct KVMFR
|
||||||
{
|
{
|
||||||
char magic[8];
|
char magic[8];
|
||||||
uint32_t version;
|
uint32_t version;
|
||||||
|
char hostver[32];
|
||||||
}
|
}
|
||||||
KVMFR;
|
KVMFR;
|
||||||
|
|
||||||
|
|
|
@ -435,9 +435,10 @@ int app_main(int argc, char * argv[])
|
||||||
DEBUG_INFO("Max Pointer Size : %u KiB", (unsigned int)MAX_POINTER_SIZE / 1024);
|
DEBUG_INFO("Max Pointer Size : %u KiB", (unsigned int)MAX_POINTER_SIZE / 1024);
|
||||||
DEBUG_INFO("KVMFR Version : %u", KVMFR_VERSION);
|
DEBUG_INFO("KVMFR Version : %u", KVMFR_VERSION);
|
||||||
|
|
||||||
KVMFR udata = {
|
const KVMFR udata = {
|
||||||
.magic = KVMFR_MAGIC,
|
.magic = KVMFR_MAGIC,
|
||||||
.version = KVMFR_VERSION
|
.version = KVMFR_VERSION,
|
||||||
|
.hostver = BUILD_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
LGMP_STATUS status;
|
LGMP_STATUS status;
|
||||||
|
|
Loading…
Reference in a new issue