[host] windows: check the ivshmem device exists in the service

This commit is contained in:
Geoffrey McRae
2020-10-19 02:49:15 +11:00
parent 7a7e1d006b
commit 9ff1859dc1
4 changed files with 100 additions and 63 deletions

View File

@@ -447,7 +447,13 @@ int app_main(int argc, char * argv[])
DEBUG_INFO("Looking Glass Host (%s)", BUILD_VERSION);
struct IVSHMEM shmDev;
struct IVSHMEM shmDev = { 0 };
if (!ivshmemInit(&shmDev))
{
DEBUG_ERROR("Failed to find the IVSHMEM device");
return -1;
}
if (!ivshmemOpen(&shmDev))
{
DEBUG_ERROR("Failed to open the IVSHMEM device");
@@ -638,6 +644,7 @@ fail:
lgmpHostFree(&app.lgmp);
ivshmemClose(&shmDev);
ivshmemFree(&shmDev);
return exitcode;
}