blob: b525ab41789a642eb225337bde1aec2231b26e9f [file] [log] [blame]
Andrew Jeffery47af65a2021-12-01 14:16:31 +10301/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16/// \file PerformScan.cpp
17#include "EntityManager.hpp"
18
19#include <boost/algorithm/string/predicate.hpp>
20#include <boost/asio/steady_timer.hpp>
21#include <boost/container/flat_map.hpp>
22#include <boost/container/flat_set.hpp>
23
24#include <charconv>
25
26/* Hacks from splitting EntityManager.cpp */
27extern std::shared_ptr<sdbusplus::asio::connection> systemBus;
28extern nlohmann::json lastJson;
29extern void
30 propertiesChangedCallback(nlohmann::json& systemConfiguration,
31 sdbusplus::asio::object_server& objServer);
32
Andrew Jeffery47af65a2021-12-01 14:16:31 +103033using GetSubTreeType = std::vector<
34 std::pair<std::string,
35 std::vector<std::pair<std::string, std::vector<std::string>>>>>;
36
37constexpr const int32_t maxMapperDepth = 0;
38
39constexpr const bool debug = false;
40
Andrew Jefferyd9b67842022-04-05 16:44:20 +093041struct DBusInterfaceInstance
42{
43 std::string busName;
44 std::string path;
45 std::string interface;
46};
47
Andrew Jeffery47af65a2021-12-01 14:16:31 +103048void getInterfaces(
Andrew Jefferyd9b67842022-04-05 16:44:20 +093049 const DBusInterfaceInstance& instance,
Andrew Jeffery47af65a2021-12-01 14:16:31 +103050 const std::vector<std::shared_ptr<PerformProbe>>& probeVector,
51 const std::shared_ptr<PerformScan>& scan, size_t retries = 5)
52{
53 if (!retries)
54 {
Andrew Jefferyd9b67842022-04-05 16:44:20 +093055 std::cerr << "retries exhausted on " << instance.busName << " "
56 << instance.path << " " << instance.interface << "\n";
Andrew Jeffery47af65a2021-12-01 14:16:31 +103057 return;
58 }
59
60 systemBus->async_method_call(
Andrew Jefferyd9b67842022-04-05 16:44:20 +093061 [instance, scan, probeVector, retries](boost::system::error_code& errc,
62 const DBusInterface& resp) {
Andrew Jeffery47af65a2021-12-01 14:16:31 +103063 if (errc)
64 {
Andrew Jefferyd9b67842022-04-05 16:44:20 +093065 std::cerr << "error calling getall on " << instance.busName
66 << " " << instance.path << " "
67 << instance.interface << "\n";
Andrew Jeffery47af65a2021-12-01 14:16:31 +103068
Andrew Jeffery91c5eaa2022-04-05 16:45:52 +093069 auto timer = std::make_shared<boost::asio::steady_timer>(io);
Andrew Jeffery47af65a2021-12-01 14:16:31 +103070 timer->expires_after(std::chrono::seconds(2));
71
Andrew Jefferyd9b67842022-04-05 16:44:20 +093072 timer->async_wait([timer, instance, scan, probeVector,
Andrew Jeffery47af65a2021-12-01 14:16:31 +103073 retries](const boost::system::error_code&) {
Andrew Jefferyd9b67842022-04-05 16:44:20 +093074 getInterfaces(instance, probeVector, scan, retries - 1);
Andrew Jeffery47af65a2021-12-01 14:16:31 +103075 });
76 return;
77 }
78
Andrew Jefferyd9b67842022-04-05 16:44:20 +093079 scan->dbusProbeObjects[instance.path][instance.interface] = resp;
Andrew Jeffery47af65a2021-12-01 14:16:31 +103080 },
Andrew Jefferyd9b67842022-04-05 16:44:20 +093081 instance.busName, instance.path, "org.freedesktop.DBus.Properties",
82 "GetAll", instance.interface);
Andrew Jeffery47af65a2021-12-01 14:16:31 +103083
84 if constexpr (debug)
85 {
86 std::cerr << __func__ << " " << __LINE__ << "\n";
87 }
88}
89
Andrew Jeffery4dcc55d2022-04-05 16:49:42 +093090static void registerCallback(nlohmann::json& systemConfiguration,
91 sdbusplus::asio::object_server& objServer,
92 const std::string& path)
Andrew Jeffery47af65a2021-12-01 14:16:31 +103093{
94 static boost::container::flat_map<std::string, sdbusplus::bus::match::match>
95 dbusMatches;
96
97 auto find = dbusMatches.find(path);
98 if (find != dbusMatches.end())
99 {
100 return;
101 }
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030102
Andrew Jeffery26db5752022-04-05 16:53:36 +0930103 std::function<void(sdbusplus::message::message & message)> eventHandler =
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030104 [&](sdbusplus::message::message&) {
105 propertiesChangedCallback(systemConfiguration, objServer);
106 };
107
108 sdbusplus::bus::match::match match(
109 static_cast<sdbusplus::bus::bus&>(*systemBus),
110 "type='signal',member='PropertiesChanged',path='" + path + "'",
111 eventHandler);
112 dbusMatches.emplace(path, std::move(match));
113}
114
Andrew Jeffery8d2761e2022-04-05 16:26:28 +0930115static void
116 processDbusObjects(std::vector<std::shared_ptr<PerformProbe>>& probeVector,
117 const std::shared_ptr<PerformScan>& scan,
118 const GetSubTreeType& interfaceSubtree)
119{
Andrew Jeffery8d2761e2022-04-05 16:26:28 +0930120 for (const auto& [path, object] : interfaceSubtree)
121 {
Andrew Jeffery47321832022-04-05 16:30:29 +0930122 // Get a PropertiesChanged callback for all interfaces on this path.
123 registerCallback(scan->_systemConfiguration, scan->objServer, path);
124
Andrew Jeffery8d2761e2022-04-05 16:26:28 +0930125 for (const auto& [busname, ifaces] : object)
126 {
127 for (const std::string& iface : ifaces)
128 {
129 // The 3 default org.freedeskstop interfaces (Peer,
130 // Introspectable, and Properties) are returned by
131 // the mapper but don't have properties, so don't bother
132 // with the GetAll call to save some cycles.
133 if (!boost::algorithm::starts_with(iface, "org.freedesktop"))
134 {
Andrew Jeffery47321832022-04-05 16:30:29 +0930135 getInterfaces({busname, path, iface}, probeVector, scan);
Andrew Jeffery8d2761e2022-04-05 16:26:28 +0930136 }
137 }
138 }
Andrew Jeffery8d2761e2022-04-05 16:26:28 +0930139 }
140}
141
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030142// Populates scan->dbusProbeObjects with all interfaces and properties
143// for the paths that own the interfaces passed in.
144void findDbusObjects(std::vector<std::shared_ptr<PerformProbe>>&& probeVector,
145 boost::container::flat_set<std::string>&& interfaces,
146 const std::shared_ptr<PerformScan>& scan,
147 size_t retries = 5)
148{
149 // Filter out interfaces already obtained.
150 for (const auto& [path, probeInterfaces] : scan->dbusProbeObjects)
151 {
152 for (const auto& [interface, _] : probeInterfaces)
153 {
154 interfaces.erase(interface);
155 }
156 }
157 if (interfaces.empty())
158 {
159 return;
160 }
161
162 // find all connections in the mapper that expose a specific type
163 systemBus->async_method_call(
164 [interfaces, probeVector{std::move(probeVector)}, scan,
165 retries](boost::system::error_code& ec,
166 const GetSubTreeType& interfaceSubtree) mutable {
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030167 if (ec)
168 {
169 if (ec.value() == ENOENT)
170 {
171 return; // wasn't found by mapper
172 }
173 std::cerr << "Error communicating to mapper.\n";
174
175 if (!retries)
176 {
177 // if we can't communicate to the mapper something is very
178 // wrong
179 std::exit(EXIT_FAILURE);
180 }
Andrew Jeffery91c5eaa2022-04-05 16:45:52 +0930181
182 auto timer = std::make_shared<boost::asio::steady_timer>(io);
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030183 timer->expires_after(std::chrono::seconds(10));
184
185 timer->async_wait(
186 [timer, interfaces{std::move(interfaces)}, scan,
187 probeVector{std::move(probeVector)},
188 retries](const boost::system::error_code&) mutable {
189 findDbusObjects(std::move(probeVector),
190 std::move(interfaces), scan,
191 retries - 1);
192 });
193 return;
194 }
195
Andrew Jeffery8d2761e2022-04-05 16:26:28 +0930196 processDbusObjects(probeVector, scan, interfaceSubtree);
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030197 },
198 "xyz.openbmc_project.ObjectMapper",
199 "/xyz/openbmc_project/object_mapper",
200 "xyz.openbmc_project.ObjectMapper", "GetSubTree", "/", maxMapperDepth,
201 interfaces);
202
203 if constexpr (debug)
204 {
205 std::cerr << __func__ << " " << __LINE__ << "\n";
206 }
207}
208
Andrew Jeffery1983d2f2022-04-05 14:55:13 +0930209std::string getRecordName(const DBusInterface& probe,
210 const std::string& probeName)
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030211{
212 if (probe.empty())
213 {
214 return probeName;
215 }
216
Andrew Jeffery928c5b22022-04-05 16:57:51 +0930217 // use an array so alphabetical order from the flat_map is maintained
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030218 auto device = nlohmann::json::array();
219 for (auto& devPair : probe)
220 {
221 device.push_back(devPair.first);
222 std::visit([&device](auto&& v) { device.push_back(v); },
223 devPair.second);
224 }
Andrew Jeffery86501872022-04-05 16:58:22 +0930225
Andrew Jeffery928c5b22022-04-05 16:57:51 +0930226 // hashes are hard to distinguish, use the non-hashed version if we want
227 // debug
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030228 if constexpr (debug)
229 {
230 return probeName + device.dump();
231 }
Andrew Jeffery1ae4ed62022-04-05 16:55:43 +0930232
Andrew Jeffery86501872022-04-05 16:58:22 +0930233 return std::to_string(std::hash<std::string>{}(probeName + device.dump()));
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030234}
235
236PerformScan::PerformScan(nlohmann::json& systemConfiguration,
237 nlohmann::json& missingConfigurations,
238 std::list<nlohmann::json>& configurations,
239 sdbusplus::asio::object_server& objServerIn,
240 std::function<void()>&& callback) :
241 _systemConfiguration(systemConfiguration),
242 _missingConfigurations(missingConfigurations),
243 _configurations(configurations), objServer(objServerIn),
244 _callback(std::move(callback))
245{}
246void PerformScan::run()
247{
248 boost::container::flat_set<std::string> dbusProbeInterfaces;
249 std::vector<std::shared_ptr<PerformProbe>> dbusProbePointers;
250
251 for (auto it = _configurations.begin(); it != _configurations.end();)
252 {
253 auto findProbe = it->find("Probe");
254 auto findName = it->find("Name");
255
256 nlohmann::json probeCommand;
257 // check for poorly formatted fields, probe must be an array
258 if (findProbe == it->end())
259 {
260 std::cerr << "configuration file missing probe:\n " << *it << "\n";
261 it = _configurations.erase(it);
262 continue;
263 }
264 if ((*findProbe).type() != nlohmann::json::value_t::array)
265 {
266 probeCommand = nlohmann::json::array();
267 probeCommand.push_back(*findProbe);
268 }
269 else
270 {
271 probeCommand = *findProbe;
272 }
273
274 if (findName == it->end())
275 {
276 std::cerr << "configuration file missing name:\n " << *it << "\n";
277 it = _configurations.erase(it);
278 continue;
279 }
280 std::string probeName = *findName;
281
282 if (std::find(passedProbes.begin(), passedProbes.end(), probeName) !=
283 passedProbes.end())
284 {
285 it = _configurations.erase(it);
286 continue;
287 }
288 nlohmann::json* recordPtr = &(*it);
289
290 // store reference to this to children to makes sure we don't get
291 // destroyed too early
292 auto thisRef = shared_from_this();
293 auto probePointer = std::make_shared<PerformProbe>(
294 probeCommand, thisRef,
Andrew Jefferyac20bd92022-04-05 11:11:40 +0930295 [&, recordPtr,
Andrew Jefferyf5772d22022-04-12 22:05:30 +0930296 probeName](FoundDevices& foundDevices,
Andrew Jefferyac20bd92022-04-05 11:11:40 +0930297 const MapperGetSubTreeResponse& allInterfaces) {
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030298 _passed = true;
299 std::set<nlohmann::json> usedNames;
300 passedProbes.push_back(probeName);
301 std::list<size_t> indexes(foundDevices.size());
302 std::iota(indexes.begin(), indexes.end(), 1);
303
304 size_t indexIdx = probeName.find('$');
305 bool hasTemplateName = (indexIdx != std::string::npos);
306
307 // copy over persisted configurations and make sure we remove
308 // indexes that are already used
309 for (auto itr = foundDevices.begin();
310 itr != foundDevices.end();)
311 {
312 std::string recordName =
Andrew Jefferyf5772d22022-04-12 22:05:30 +0930313 getRecordName(itr->interface, probeName);
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030314
315 auto fromLastJson = lastJson.find(recordName);
316 if (fromLastJson != lastJson.end())
317 {
318 auto findExposes = fromLastJson->find("Exposes");
319 // delete nulls from any updates
320 if (findExposes != fromLastJson->end())
321 {
322 auto copy = nlohmann::json::array();
323 for (auto& expose : *findExposes)
324 {
325 if (expose.is_null())
326 {
327 continue;
328 }
329 copy.emplace_back(expose);
330 }
331 *findExposes = copy;
332 }
333
334 // keep user changes
335 _systemConfiguration[recordName] = *fromLastJson;
336 _missingConfigurations.erase(recordName);
337 itr = foundDevices.erase(itr);
338 if (hasTemplateName)
339 {
340 auto nameIt = fromLastJson->find("Name");
341 if (nameIt == fromLastJson->end())
342 {
343 std::cerr << "Last JSON Illegal\n";
344 continue;
345 }
346 int index = 0;
347 auto str =
348 nameIt->get<std::string>().substr(indexIdx);
349 auto [p, ec] = std::from_chars(
350 str.data(), str.data() + str.size(), index);
351 if (ec != std::errc())
352 {
353 continue; // non-numeric replacement
354 }
355 usedNames.insert(nameIt.value());
356 auto usedIt = std::find(indexes.begin(),
357 indexes.end(), index);
358
359 if (usedIt == indexes.end())
360 {
361 continue; // less items now
362 }
363 indexes.erase(usedIt);
364 }
365
366 continue;
367 }
368 itr++;
369 }
370
371 std::optional<std::string> replaceStr;
372
Andrew Jeffery0a8de742022-04-12 22:32:01 +0930373 DBusObject emptyObject;
Andrew Jeffery1983d2f2022-04-05 14:55:13 +0930374 DBusInterface emptyInterface;
Andrew Jeffery0a8de742022-04-12 22:32:01 +0930375 emptyObject.emplace(std::string{}, emptyInterface);
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030376
Andrew Jeffery920a2812022-04-12 22:17:32 +0930377 for (const auto& [foundDevice, path] : foundDevices)
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030378 {
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030379 // Need all interfaces on this path so that template
380 // substitutions can be done with any of the contained
381 // properties. If the probe that passed didn't use an
382 // interface, such as if it was just TRUE, then
383 // templateCharReplace will just get passed in an empty
384 // map.
Andrew Jeffery0a8de742022-04-12 22:32:01 +0930385 const DBusObject* dbusObject = &emptyObject;
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030386
387 auto ifacesIt = allInterfaces.find(path);
388 if (ifacesIt != allInterfaces.end())
389 {
Andrew Jefferyc6558f62022-04-05 15:39:31 +0930390 dbusObject = &ifacesIt->second;
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030391 }
392
393 nlohmann::json record = *recordPtr;
394 std::string recordName =
395 getRecordName(foundDevice, probeName);
396 size_t foundDeviceIdx = indexes.front();
397 indexes.pop_front();
398
399 // check name first so we have no duplicate names
400 auto getName = record.find("Name");
401 if (getName == record.end())
402 {
403 std::cerr << "Record Missing Name! " << record.dump();
404 continue; // this should be impossible at this level
405 }
406
407 nlohmann::json copyForName = {{"Name", getName.value()}};
408 nlohmann::json::iterator copyIt = copyForName.begin();
Andrew Jefferyc6558f62022-04-05 15:39:31 +0930409 std::optional<std::string> replaceVal = templateCharReplace(
410 copyIt, *dbusObject, foundDeviceIdx, replaceStr);
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030411
412 if (!replaceStr && replaceVal)
413 {
414 if (usedNames.find(copyIt.value()) != usedNames.end())
415 {
416 replaceStr = replaceVal;
417 copyForName = {{"Name", getName.value()}};
418 copyIt = copyForName.begin();
Andrew Jefferyc6558f62022-04-05 15:39:31 +0930419 templateCharReplace(copyIt, *dbusObject,
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030420 foundDeviceIdx, replaceStr);
421 }
422 }
423
424 if (replaceStr)
425 {
426 std::cerr << "Duplicates found, replacing "
427 << *replaceStr
428 << " with found device index.\n Consider "
429 "fixing template to not have duplicates\n";
430 }
431
432 for (auto keyPair = record.begin(); keyPair != record.end();
433 keyPair++)
434 {
435 if (keyPair.key() == "Name")
436 {
437 keyPair.value() = copyIt.value();
438 usedNames.insert(copyIt.value());
439
440 continue; // already covered above
441 }
Andrew Jefferyc6558f62022-04-05 15:39:31 +0930442 templateCharReplace(keyPair, *dbusObject,
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030443 foundDeviceIdx, replaceStr);
444 }
445
446 // insert into configuration temporarily to be able to
447 // reference ourselves
448
449 _systemConfiguration[recordName] = record;
450
451 auto findExpose = record.find("Exposes");
452 if (findExpose == record.end())
453 {
454 _systemConfiguration[recordName] = record;
455 continue;
456 }
457
458 for (auto& expose : *findExpose)
459 {
460 for (auto keyPair = expose.begin();
461 keyPair != expose.end(); keyPair++)
462 {
463
Andrew Jefferyc6558f62022-04-05 15:39:31 +0930464 templateCharReplace(keyPair, *dbusObject,
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030465 foundDeviceIdx, replaceStr);
466
467 bool isBind =
468 boost::starts_with(keyPair.key(), "Bind");
469 bool isDisable = keyPair.key() == "DisableNode";
470
471 // special cases
472 if (!(isBind || isDisable))
473 {
474 continue;
475 }
476
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030477 std::vector<std::string> matches;
478 if (keyPair.value().type() ==
479 nlohmann::json::value_t::string)
480 {
481 matches.emplace_back(keyPair.value());
482 }
Andrew Jeffery3c5f12b2022-04-07 09:49:15 +0930483 else if (keyPair.value().type() ==
484 nlohmann::json::value_t::array)
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030485 {
486 for (const auto& value : keyPair.value())
487 {
488 if (value.type() !=
489 nlohmann::json::value_t::string)
490 {
491 std::cerr << "Value is invalid type "
492 << value << "\n";
493 break;
494 }
495 matches.emplace_back(value);
496 }
497 }
Andrew Jeffery3c5f12b2022-04-07 09:49:15 +0930498 else
499 {
500 std::cerr << "Value is invalid type "
501 << keyPair.key() << "\n";
502 continue;
503 }
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030504
505 std::set<std::string> foundMatches;
Andrew Jefferyf5184712022-03-25 13:38:07 +1030506 for (auto& [configId, config] :
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030507 _systemConfiguration.items())
508 {
509 if (isDisable)
510 {
511 // don't disable ourselves
Andrew Jefferyf5184712022-03-25 13:38:07 +1030512 if (configId == recordName)
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030513 {
514 continue;
515 }
516 }
Andrew Jefferyf5184712022-03-25 13:38:07 +1030517 auto configListFind = config.find("Exposes");
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030518
Andrew Jefferyf5184712022-03-25 13:38:07 +1030519 if (configListFind == config.end() ||
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030520 configListFind->type() !=
521 nlohmann::json::value_t::array)
522 {
523 continue;
524 }
525 for (auto& exposedObject : *configListFind)
526 {
527 auto matchIt = std::find_if(
528 matches.begin(), matches.end(),
529 [name = (exposedObject)["Name"]
530 .get<std::string>()](
531 const std::string& s) {
532 return s == name;
533 });
534 if (matchIt == matches.end())
535 {
536 continue;
537 }
538 foundMatches.insert(*matchIt);
539
540 if (isBind)
541 {
542 std::string bind = keyPair.key().substr(
543 sizeof("Bind") - 1);
544
545 exposedObject["Status"] = "okay";
546 expose[bind] = exposedObject;
547 }
548 else if (isDisable)
549 {
550 exposedObject["Status"] = "disabled";
551 }
552 }
553 }
554 if (foundMatches.size() != matches.size())
555 {
556 std::cerr << "configuration file "
557 "dependency error, "
558 "could not find "
559 << keyPair.key() << " "
560 << keyPair.value() << "\n";
561 }
562 }
563 }
564 // overwrite ourselves with cleaned up version
565 _systemConfiguration[recordName] = record;
566 _missingConfigurations.erase(recordName);
567 }
568 });
569
570 // parse out dbus probes by discarding other probe types, store in a
571 // map
572 for (const nlohmann::json& probeJson : probeCommand)
573 {
574 const std::string* probe = probeJson.get_ptr<const std::string*>();
575 if (probe == nullptr)
576 {
577 std::cerr << "Probe statement wasn't a string, can't parse";
578 continue;
579 }
Andrew Jeffery666583b2021-12-01 15:50:12 +1030580 if (findProbeType(probe->c_str()))
Andrew Jeffery47af65a2021-12-01 14:16:31 +1030581 {
582 continue;
583 }
584 // syntax requires probe before first open brace
585 auto findStart = probe->find('(');
586 std::string interface = probe->substr(0, findStart);
587 dbusProbeInterfaces.emplace(interface);
588 dbusProbePointers.emplace_back(probePointer);
589 }
590 it++;
591 }
592
593 // probe vector stores a shared_ptr to each PerformProbe that cares
594 // about a dbus interface
595 findDbusObjects(std::move(dbusProbePointers),
596 std::move(dbusProbeInterfaces), shared_from_this());
597 if constexpr (debug)
598 {
599 std::cerr << __func__ << " " << __LINE__ << "\n";
600 }
601}
602
603PerformScan::~PerformScan()
604{
605 if (_passed)
606 {
607 auto nextScan = std::make_shared<PerformScan>(
608 _systemConfiguration, _missingConfigurations, _configurations,
609 objServer, std::move(_callback));
610 nextScan->passedProbes = std::move(passedProbes);
611 nextScan->dbusProbeObjects = std::move(dbusProbeObjects);
612 nextScan->run();
613
614 if constexpr (debug)
615 {
616 std::cerr << __func__ << " " << __LINE__ << "\n";
617 }
618 }
619 else
620 {
621 _callback();
622
623 if constexpr (debug)
624 {
625 std::cerr << __func__ << " " << __LINE__ << "\n";
626 }
627 }
628}