| 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 | { |
nothing calls this directly
no outgoing calls
no test coverage detected