mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 00:28:20 +00:00
[client/host] share the host version with the client for diagnostics
This commit is contained in:
parent
667ab981ba
commit
553e2830bb
@ -1474,19 +1474,25 @@ static int lg_run()
|
||||
if (!state.running)
|
||||
return -1;
|
||||
|
||||
if (udataSize != sizeof(KVMFR) ||
|
||||
memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 ||
|
||||
udata->version != KVMFR_VERSION)
|
||||
const bool magicMatches = memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) == 0;
|
||||
if (udataSize != sizeof(KVMFR) || !magicMatches || udata->version != KVMFR_VERSION)
|
||||
{
|
||||
DEBUG_BREAK();
|
||||
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("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();
|
||||
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))
|
||||
{
|
||||
|
@ -51,12 +51,13 @@ typedef enum CursorType
|
||||
CursorType;
|
||||
|
||||
#define KVMFR_MAGIC "KVMFR---"
|
||||
#define KVMFR_VERSION 1
|
||||
#define KVMFR_VERSION 2
|
||||
|
||||
typedef struct KVMFR
|
||||
{
|
||||
char magic[8];
|
||||
uint32_t version;
|
||||
char hostver[32];
|
||||
}
|
||||
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("KVMFR Version : %u", KVMFR_VERSION);
|
||||
|
||||
KVMFR udata = {
|
||||
const KVMFR udata = {
|
||||
.magic = KVMFR_MAGIC,
|
||||
.version = KVMFR_VERSION
|
||||
.version = KVMFR_VERSION,
|
||||
.hostver = BUILD_VERSION
|
||||
};
|
||||
|
||||
LGMP_STATUS status;
|
||||
|
Loading…
Reference in New Issue
Block a user