MCPcopy Create free account
hub / github.com/USBGuard/usbguard / umockdevAdd

Method umockdevAdd

src/Library/UMockdevDeviceManager.cpp:211–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209 }
210
211 void UMockdevDeviceManager::umockdevAdd(const std::shared_ptr<UMockdevDeviceDefinition>& definition)
212 {
213 if (access((SysFSDevice::getSysfsRoot() + definition->getSysfsPath()).c_str(), F_OK) == 0) {
214 USBGUARD_LOG(Debug) << "Device already defined: " << definition->getSysfsPath();
215 return;
216 }
217
218 umockdev_testbed_add_from_string(_testbed.get(), definition->getUMockdevDefinition().c_str(), /*error=*/nullptr);
219 umockdev_testbed_uevent(_testbed.get(), (SysFSDevice::getSysfsRoot() + definition->getSysfsPath()).c_str(), "add");
220 }
221
222 void UMockdevDeviceManager::umockdevRemove(const std::shared_ptr<UMockdevDeviceDefinition>& definition)
223 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected