mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 23:07:18 +00:00
[c-host] linux: remove extra shm device name validation
This is now validated by the option validator callback
This commit is contained in:
parent
cf030f6f0c
commit
522bacb1f0
@ -200,28 +200,7 @@ bool app_init()
|
|||||||
{
|
{
|
||||||
const char * shmDevice = option_get_string("os", "shmDevice");
|
const char * shmDevice = option_get_string("os", "shmDevice");
|
||||||
|
|
||||||
// check the deice name
|
|
||||||
{
|
|
||||||
char * name = uioGetName(shmDevice);
|
|
||||||
if (!name)
|
|
||||||
{
|
|
||||||
DEBUG_ERROR("Failed to read the shmDevice name for: %s", shmDevice);
|
|
||||||
DEBUG_ERROR("Did you remmeber to modprobe the kvmfr module?");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strcmp(name, "KVMFR") != 0)
|
|
||||||
{
|
|
||||||
free(name);
|
|
||||||
DEBUG_ERROR("Device is not a KVMFR device \"%s\" reports as: %s", shmDevice, name);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// get the device size
|
// get the device size
|
||||||
{
|
|
||||||
int fd = uioOpenFile(shmDevice, "maps/map0/size");
|
int fd = uioOpenFile(shmDevice, "maps/map0/size");
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
@ -242,20 +221,16 @@ bool app_init()
|
|||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
app.shmSize = strtoul(size, NULL, 16);
|
app.shmSize = strtoul(size, NULL, 16);
|
||||||
}
|
|
||||||
|
|
||||||
// open the device
|
// open the device
|
||||||
{
|
|
||||||
app.shmFD = shmOpenDev(shmDevice);
|
app.shmFD = shmOpenDev(shmDevice);
|
||||||
app.shmMap = MAP_FAILED;
|
app.shmMap = MAP_FAILED;
|
||||||
if (app.shmFD < 0)
|
if (app.shmFD < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DEBUG_INFO("KVMFR Device : %s", shmDevice);
|
DEBUG_INFO("KVMFR Device : %s", shmDevice);
|
||||||
}
|
|
||||||
|
|
||||||
signal(SIGINT, sigHandler);
|
signal(SIGINT, sigHandler);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user