blob: 4306f1624efbefee0bd59d9a20c63dd21a20bff8 [file] [log] [blame]
James Feist6714a252018-09-10 15:26:18 -07001/*
2// Copyright (c) 2017 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
Patrick Ventureca44b2f2019-10-31 11:02:26 -070017#include "PwmSensor.hpp"
18#include "TachSensor.hpp"
19#include "Utils.hpp"
20#include "VariantVisitors.hpp"
21
James Feist6714a252018-09-10 15:26:18 -070022#include <boost/algorithm/string/predicate.hpp>
23#include <boost/algorithm/string/replace.hpp>
Patrick Venture96e97db2019-10-31 13:44:38 -070024#include <boost/container/flat_map.hpp>
James Feist6714a252018-09-10 15:26:18 -070025#include <boost/container/flat_set.hpp>
26#include <boost/lexical_cast.hpp>
James Feist38fb5982020-05-28 10:09:54 -070027#include <sdbusplus/asio/connection.hpp>
28#include <sdbusplus/asio/object_server.hpp>
29#include <sdbusplus/bus/match.hpp>
30
31#include <array>
James Feist24f02f22019-04-15 11:05:39 -070032#include <filesystem>
James Feist6714a252018-09-10 15:26:18 -070033#include <fstream>
Patrick Venture96e97db2019-10-31 13:44:38 -070034#include <functional>
35#include <memory>
36#include <optional>
James Feist6714a252018-09-10 15:26:18 -070037#include <regex>
Patrick Venture96e97db2019-10-31 13:44:38 -070038#include <string>
39#include <utility>
40#include <variant>
41#include <vector>
James Feist6714a252018-09-10 15:26:18 -070042
43static constexpr bool DEBUG = false;
44
James Feistcf3bce62019-01-08 10:07:19 -080045namespace fs = std::filesystem;
James Feist3eb82622019-02-08 13:10:22 -080046
Yong Zhaoa3e8f2a2021-01-09 02:22:43 +000047// The following two structures need to be consistent
Peter Lundgren8843b622019-09-12 10:33:41 -070048static constexpr std::array<const char*, 3> sensorTypes = {
James Feist95b079b2018-11-21 09:28:00 -080049 "xyz.openbmc_project.Configuration.AspeedFan",
Peter Lundgren8843b622019-09-12 10:33:41 -070050 "xyz.openbmc_project.Configuration.I2CFan",
51 "xyz.openbmc_project.Configuration.NuvotonFan"};
Yong Zhaoa3e8f2a2021-01-09 02:22:43 +000052
53enum FanTypes
54{
55 aspeed = 0,
56 i2c,
57 nuvoton,
58 max,
59};
60
61static_assert(std::tuple_size<decltype(sensorTypes)>::value == FanTypes::max,
62 "sensorTypes element number is not equal to FanTypes number");
63
James Feistdc6c55f2018-10-31 12:53:20 -070064constexpr const char* redundancyConfiguration =
65 "xyz.openbmc_project.Configuration.FanRedundancy";
Jae Hyun Yoo9ced0a32018-10-25 10:42:39 -070066static std::regex inputRegex(R"(fan(\d+)_input)");
James Feist6714a252018-09-10 15:26:18 -070067
James Feistdc6c55f2018-10-31 12:53:20 -070068// todo: power supply fan redundancy
James Feist7b18b1e2019-05-14 13:42:09 -070069std::optional<RedundancySensor> systemRedundancy;
James Feist95b079b2018-11-21 09:28:00 -080070
71FanTypes getFanType(const fs::path& parentPath)
72{
73 fs::path linkPath = parentPath / "device";
74 std::string canonical = fs::read_symlink(linkPath);
Jae Hyun Yoo241356e2020-02-20 12:48:04 -080075 if (boost::ends_with(canonical, "1e786000.pwm-tacho-controller") ||
76 boost::ends_with(canonical, "1e610000.pwm-tacho-controller"))
James Feist95b079b2018-11-21 09:28:00 -080077 {
78 return FanTypes::aspeed;
79 }
Peter Lundgren8843b622019-09-12 10:33:41 -070080 else if (boost::ends_with(canonical, "f0103000.pwm-fan-controller"))
81 {
82 return FanTypes::nuvoton;
83 }
James Feist95b079b2018-11-21 09:28:00 -080084 // todo: will we need to support other types?
85 return FanTypes::i2c;
86}
James Feistdc6c55f2018-10-31 12:53:20 -070087
Kuiying Wangd5407412020-09-09 16:06:56 +080088void createRedundancySensor(
89 const boost::container::flat_map<std::string, std::unique_ptr<TachSensor>>&
90 sensors,
91 std::shared_ptr<sdbusplus::asio::connection> conn,
92 sdbusplus::asio::object_server& objectServer)
93{
94
95 conn->async_method_call(
96 [&objectServer, &sensors](boost::system::error_code& ec,
97 const ManagedObjectType managedObj) {
98 if (ec)
99 {
100 std::cerr << "Error calling entity manager \n";
101 return;
102 }
103 for (const auto& pathPair : managedObj)
104 {
105 for (const auto& interfacePair : pathPair.second)
106 {
107 if (interfacePair.first == redundancyConfiguration)
108 {
109 // currently only support one
110 auto findCount =
111 interfacePair.second.find("AllowedFailures");
112 if (findCount == interfacePair.second.end())
113 {
114 std::cerr << "Malformed redundancy record \n";
115 return;
116 }
117 std::vector<std::string> sensorList;
118
119 for (const auto& sensor : sensors)
120 {
121 sensorList.push_back(
122 "/xyz/openbmc_project/sensors/fan_tach/" +
123 sensor.second->name);
124 }
125 systemRedundancy.reset();
126 systemRedundancy.emplace(RedundancySensor(
127 std::get<uint64_t>(findCount->second), sensorList,
128 objectServer, pathPair.first));
129
130 return;
131 }
132 }
133 }
134 },
135 "xyz.openbmc_project.EntityManager", "/",
136 "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
137}
138
James Feist6714a252018-09-10 15:26:18 -0700139void createSensors(
140 boost::asio::io_service& io, sdbusplus::asio::object_server& objectServer,
141 boost::container::flat_map<std::string, std::unique_ptr<TachSensor>>&
142 tachSensors,
143 boost::container::flat_map<std::string, std::unique_ptr<PwmSensor>>&
144 pwmSensors,
145 std::shared_ptr<sdbusplus::asio::connection>& dbusConnection,
James Feist5591cf082020-07-15 16:44:54 -0700146 const std::shared_ptr<boost::container::flat_set<std::string>>&
James Feistf27a55c2020-08-04 14:27:30 -0700147 sensorsChanged,
148 size_t retries = 0)
James Feist6714a252018-09-10 15:26:18 -0700149{
James Feistde5e9702019-09-18 16:13:02 -0700150 auto getter = std::make_shared<GetSensorConfiguration>(
151 dbusConnection,
152 std::move([&io, &objectServer, &tachSensors, &pwmSensors,
James Feist5591cf082020-07-15 16:44:54 -0700153 &dbusConnection, sensorsChanged](
James Feistde5e9702019-09-18 16:13:02 -0700154 const ManagedObjectType& sensorConfigurations) {
155 bool firstScan = sensorsChanged == nullptr;
156 std::vector<fs::path> paths;
157 if (!findFiles(fs::path("/sys/class/hwmon"), R"(fan\d+_input)",
158 paths))
James Feist95b079b2018-11-21 09:28:00 -0800159 {
James Feistde5e9702019-09-18 16:13:02 -0700160 std::cerr << "No temperature sensors in system\n";
161 return;
James Feist95b079b2018-11-21 09:28:00 -0800162 }
James Feist6714a252018-09-10 15:26:18 -0700163
Jason Lingd320a2e2020-07-11 14:08:14 -0700164 // pwm index, sysfs path, pwm name
165 std::vector<std::tuple<uint8_t, std::string, std::string>>
166 pwmNumbers;
James Feistde5e9702019-09-18 16:13:02 -0700167
168 // iterate through all found fan sensors, and try to match them with
169 // configuration
170 for (const auto& path : paths)
James Feist6714a252018-09-10 15:26:18 -0700171 {
James Feistde5e9702019-09-18 16:13:02 -0700172 std::smatch match;
173 std::string pathStr = path.string();
174
175 std::regex_search(pathStr, match, inputRegex);
176 std::string indexStr = *(match.begin() + 1);
177
178 auto directory = path.parent_path();
179 FanTypes fanType = getFanType(directory);
180 size_t bus = 0;
181 size_t address = 0;
182 if (fanType == FanTypes::i2c)
James Feist6714a252018-09-10 15:26:18 -0700183 {
James Feistde5e9702019-09-18 16:13:02 -0700184 std::string link =
185 fs::read_symlink(directory / "device").filename();
186
187 size_t findDash = link.find("-");
188 if (findDash == std::string::npos ||
189 link.size() <= findDash + 1)
190 {
191 std::cerr << "Error finding device from symlink";
192 }
193 bus = std::stoi(link.substr(0, findDash));
194 address = std::stoi(link.substr(findDash + 1), nullptr, 16);
James Feist6714a252018-09-10 15:26:18 -0700195 }
James Feistde5e9702019-09-18 16:13:02 -0700196 // convert to 0 based
197 size_t index = std::stoul(indexStr) - 1;
198
199 const char* baseType;
200 const SensorData* sensorData = nullptr;
201 const std::string* interfacePath = nullptr;
202 const SensorBaseConfiguration* baseConfiguration = nullptr;
203 for (const std::pair<sdbusplus::message::object_path,
204 SensorData>& sensor : sensorConfigurations)
James Feist95b079b2018-11-21 09:28:00 -0800205 {
James Feistde5e9702019-09-18 16:13:02 -0700206 // find the base of the configuration to see if indexes
207 // match
Yong Zhaoa3e8f2a2021-01-09 02:22:43 +0000208 auto sensorBaseFind =
209 sensor.second.find(sensorTypes[fanType]);
210 if (sensorBaseFind == sensor.second.end())
James Feistde5e9702019-09-18 16:13:02 -0700211 {
212 continue;
213 }
Zhikui Ren347dd4e2019-12-12 13:39:50 -0800214
Yong Zhaoa3e8f2a2021-01-09 02:22:43 +0000215 baseConfiguration = &(*sensorBaseFind);
216 interfacePath = &(sensor.first.str);
217 baseType = sensorTypes[fanType];
218
James Feistde5e9702019-09-18 16:13:02 -0700219 auto findIndex = baseConfiguration->second.find("Index");
220 if (findIndex == baseConfiguration->second.end())
221 {
222 std::cerr << baseConfiguration->first
223 << " missing index\n";
224 continue;
225 }
226 unsigned int configIndex = std::visit(
227 VariantToUnsignedIntVisitor(), findIndex->second);
228 if (configIndex != index)
229 {
230 continue;
231 }
232 if (fanType == FanTypes::aspeed ||
233 fanType == FanTypes::nuvoton)
234 {
235 // there will be only 1 aspeed or nuvoton sensor object
236 // in sysfs, we found the fan
237 sensorData = &(sensor.second);
238 break;
239 }
Yong Zhaoa3e8f2a2021-01-09 02:22:43 +0000240 else if (fanType == FanTypes::i2c)
James Feistde5e9702019-09-18 16:13:02 -0700241 {
242 auto findBus = baseConfiguration->second.find("Bus");
243 auto findAddress =
244 baseConfiguration->second.find("Address");
245 if (findBus == baseConfiguration->second.end() ||
246 findAddress == baseConfiguration->second.end())
247 {
248 std::cerr << baseConfiguration->first
249 << " missing bus or address\n";
250 continue;
251 }
252 unsigned int configBus = std::visit(
253 VariantToUnsignedIntVisitor(), findBus->second);
254 unsigned int configAddress = std::visit(
255 VariantToUnsignedIntVisitor(), findAddress->second);
256
257 if (configBus == bus && configAddress == address)
258 {
259 sensorData = &(sensor.second);
260 break;
261 }
262 }
263 }
264 if (sensorData == nullptr)
265 {
266 std::cerr << "failed to find match for " << path.string()
267 << "\n";
James Feist95b079b2018-11-21 09:28:00 -0800268 continue;
269 }
James Feist95b079b2018-11-21 09:28:00 -0800270
James Feistde5e9702019-09-18 16:13:02 -0700271 auto findSensorName = baseConfiguration->second.find("Name");
Zhikui Ren347dd4e2019-12-12 13:39:50 -0800272
James Feistde5e9702019-09-18 16:13:02 -0700273 if (findSensorName == baseConfiguration->second.end())
James Feist95b079b2018-11-21 09:28:00 -0800274 {
James Feistde5e9702019-09-18 16:13:02 -0700275 std::cerr << "could not determine configuration name for "
276 << path.string() << "\n";
277 continue;
278 }
279 std::string sensorName =
280 std::get<std::string>(findSensorName->second);
Zhikui Ren347dd4e2019-12-12 13:39:50 -0800281
James Feistde5e9702019-09-18 16:13:02 -0700282 // on rescans, only update sensors we were signaled by
283 auto findSensor = tachSensors.find(sensorName);
284 if (!firstScan && findSensor != tachSensors.end())
285 {
286 bool found = false;
287 for (auto it = sensorsChanged->begin();
288 it != sensorsChanged->end(); it++)
289 {
290 if (boost::ends_with(*it, findSensor->second->name))
291 {
292 sensorsChanged->erase(it);
293 findSensor->second = nullptr;
294 found = true;
295 break;
296 }
297 }
298 if (!found)
299 {
300 continue;
301 }
302 }
303 std::vector<thresholds::Threshold> sensorThresholds;
304 if (!parseThresholdsFromConfig(*sensorData, sensorThresholds))
305 {
306 std::cerr << "error populating thresholds for "
307 << sensorName << "\n";
308 }
309
310 auto presenceConfig =
311 sensorData->find(baseType + std::string(".Presence"));
312
313 std::unique_ptr<PresenceSensor> presenceSensor(nullptr);
314
315 // presence sensors are optional
316 if (presenceConfig != sensorData->end())
317 {
James Feistde5e9702019-09-18 16:13:02 -0700318 auto findPolarity = presenceConfig->second.find("Polarity");
Zhikui Ren347dd4e2019-12-12 13:39:50 -0800319 auto findPinName = presenceConfig->second.find("PinName");
James Feistde5e9702019-09-18 16:13:02 -0700320
Zhikui Ren347dd4e2019-12-12 13:39:50 -0800321 if (findPinName == presenceConfig->second.end() ||
James Feistde5e9702019-09-18 16:13:02 -0700322 findPolarity == presenceConfig->second.end())
323 {
324 std::cerr << "Malformed Presence Configuration\n";
325 }
326 else
327 {
James Feistde5e9702019-09-18 16:13:02 -0700328 bool inverted = std::get<std::string>(
329 findPolarity->second) == "Low";
Zhikui Ren347dd4e2019-12-12 13:39:50 -0800330 if (auto pinName =
331 std::get_if<std::string>(&findPinName->second))
332 {
333 presenceSensor = std::make_unique<PresenceSensor>(
334 *pinName, inverted, io, sensorName);
335 }
336 else
337 {
338 std::cerr
339 << "Malformed Presence pinName for sensor "
340 << sensorName << " \n";
341 }
James Feistde5e9702019-09-18 16:13:02 -0700342 }
343 }
344 std::optional<RedundancySensor>* redundancy = nullptr;
345 if (fanType == FanTypes::aspeed)
346 {
347 redundancy = &systemRedundancy;
348 }
349
Josh Lehanf920e092020-08-07 00:12:54 -0700350 PowerState powerState = PowerState::on;
351 auto findPower = baseConfiguration->second.find("PowerState");
352 if (findPower != baseConfiguration->second.end())
353 {
354 auto ptrPower =
355 std::get_if<std::string>(&(findPower->second));
356 if (ptrPower)
357 {
358 setReadState(*ptrPower, powerState);
359 }
360 }
361
James Feistde5e9702019-09-18 16:13:02 -0700362 constexpr double defaultMaxReading = 25000;
363 constexpr double defaultMinReading = 0;
364 auto limits =
365 std::make_pair(defaultMinReading, defaultMaxReading);
366
James Feist49a8ccd2020-09-16 16:09:52 -0700367 auto connector =
368 sensorData->find(baseType + std::string(".Connector"));
369
370 std::optional<std::string> led;
371
372 if (connector != sensorData->end())
373 {
374 auto findPwm = connector->second.find("Pwm");
375 if (findPwm != connector->second.end())
376 {
377
378 size_t pwm = std::visit(VariantToUnsignedIntVisitor(),
379 findPwm->second);
380 /* use pwm name override if found in configuration else
381 * use default */
382 auto findOverride = connector->second.find("PwmName");
383 std::string pwmName;
384 if (findOverride != connector->second.end())
385 {
386 pwmName = std::visit(VariantToStringVisitor(),
387 findOverride->second);
388 }
389 else
390 {
391 pwmName = "Pwm_" + std::to_string(pwm + 1);
392 }
393 pwmNumbers.emplace_back(pwm, *interfacePath, pwmName);
394 }
395 else
396 {
397 std::cerr << "Connector for " << sensorName
398 << " missing pwm!\n";
399 }
400
401 auto findLED = connector->second.find("LED");
402 if (findLED != connector->second.end())
403 {
404 auto ledName =
405 std::get_if<std::string>(&(findLED->second));
406 if (ledName == nullptr)
407 {
408 std::cerr << "Wrong format for LED of "
409 << sensorName << "\n";
410 }
411 else
412 {
413 led = *ledName;
414 }
415 }
416 }
417
James Feistde5e9702019-09-18 16:13:02 -0700418 findLimits(limits, baseConfiguration);
419 tachSensors[sensorName] = std::make_unique<TachSensor>(
420 path.string(), baseType, objectServer, dbusConnection,
421 std::move(presenceSensor), redundancy, io, sensorName,
Josh Lehanf920e092020-08-07 00:12:54 -0700422 std::move(sensorThresholds), *interfacePath, limits,
James Feist49a8ccd2020-09-16 16:09:52 -0700423 powerState, led);
James Feist95b079b2018-11-21 09:28:00 -0800424 }
Kuiying Wangd5407412020-09-09 16:06:56 +0800425 createRedundancySensor(tachSensors, dbusConnection, objectServer);
James Feistde5e9702019-09-18 16:13:02 -0700426 std::vector<fs::path> pwms;
427 if (!findFiles(fs::path("/sys/class/hwmon"), R"(pwm\d+$)", pwms))
James Feist6714a252018-09-10 15:26:18 -0700428 {
James Feistde5e9702019-09-18 16:13:02 -0700429 std::cerr << "No pwm in system\n";
430 return;
431 }
432 for (const fs::path& pwm : pwms)
433 {
434 if (pwmSensors.find(pwm) != pwmSensors.end())
James Feist6714a252018-09-10 15:26:18 -0700435 {
James Feistde5e9702019-09-18 16:13:02 -0700436 continue;
James Feist6714a252018-09-10 15:26:18 -0700437 }
James Feistde5e9702019-09-18 16:13:02 -0700438 const std::string* path = nullptr;
Jason Lingd320a2e2020-07-11 14:08:14 -0700439 const std::string* pwmName = nullptr;
440
441 for (const auto& [index, configPath, name] : pwmNumbers)
James Feistde5e9702019-09-18 16:13:02 -0700442 {
Jae Hyun Yoodadbbb52020-10-21 13:28:02 -0700443 if (pwm.filename().string() ==
444 "pwm" + std::to_string(index + 1))
James Feistde5e9702019-09-18 16:13:02 -0700445 {
446 path = &configPath;
Jason Lingd320a2e2020-07-11 14:08:14 -0700447 pwmName = &name;
James Feistde5e9702019-09-18 16:13:02 -0700448 break;
449 }
450 }
451
452 if (path == nullptr)
453 {
454 continue;
455 }
456
457 // only add new elements
458 const std::string& sysPath = pwm.string();
James Feistde5e9702019-09-18 16:13:02 -0700459 pwmSensors.insert(
460 std::pair<std::string, std::unique_ptr<PwmSensor>>(
461 sysPath, std::make_unique<PwmSensor>(
Jason Lingd320a2e2020-07-11 14:08:14 -0700462 *pwmName, sysPath, dbusConnection,
AppaRao Pulid9d8caf2020-02-27 20:56:59 +0530463 objectServer, *path, "Fan")));
James Feist6714a252018-09-10 15:26:18 -0700464 }
James Feistde5e9702019-09-18 16:13:02 -0700465 }));
466 getter->getConfiguration(
James Feistf27a55c2020-08-04 14:27:30 -0700467 std::vector<std::string>{sensorTypes.begin(), sensorTypes.end()},
468 retries);
James Feist6714a252018-09-10 15:26:18 -0700469}
470
James Feistb6c0b912019-07-09 12:21:44 -0700471int main()
James Feist6714a252018-09-10 15:26:18 -0700472{
473 boost::asio::io_service io;
474 auto systemBus = std::make_shared<sdbusplus::asio::connection>(io);
475 systemBus->request_name("xyz.openbmc_project.FanSensor");
476 sdbusplus::asio::object_server objectServer(systemBus);
477 boost::container::flat_map<std::string, std::unique_ptr<TachSensor>>
478 tachSensors;
479 boost::container::flat_map<std::string, std::unique_ptr<PwmSensor>>
480 pwmSensors;
481 std::vector<std::unique_ptr<sdbusplus::bus::match::match>> matches;
James Feist5591cf082020-07-15 16:44:54 -0700482 auto sensorsChanged =
483 std::make_shared<boost::container::flat_set<std::string>>();
James Feist6714a252018-09-10 15:26:18 -0700484
485 io.post([&]() {
486 createSensors(io, objectServer, tachSensors, pwmSensors, systemBus,
487 nullptr);
488 });
489
490 boost::asio::deadline_timer filterTimer(io);
491 std::function<void(sdbusplus::message::message&)> eventHandler =
492 [&](sdbusplus::message::message& message) {
493 if (message.is_method_error())
494 {
495 std::cerr << "callback method error\n";
496 return;
497 }
498 sensorsChanged->insert(message.get_path());
499 // this implicitly cancels the timer
500 filterTimer.expires_from_now(boost::posix_time::seconds(1));
501
502 filterTimer.async_wait([&](const boost::system::error_code& ec) {
503 if (ec == boost::asio::error::operation_aborted)
504 {
505 /* we were canceled*/
506 return;
507 }
508 else if (ec)
509 {
510 std::cerr << "timer error\n";
511 return;
512 }
513 createSensors(io, objectServer, tachSensors, pwmSensors,
James Feistf27a55c2020-08-04 14:27:30 -0700514 systemBus, sensorsChanged, 5);
James Feist6714a252018-09-10 15:26:18 -0700515 });
516 };
517
Jae Hyun Yoo9ced0a32018-10-25 10:42:39 -0700518 for (const char* type : sensorTypes)
James Feist6714a252018-09-10 15:26:18 -0700519 {
520 auto match = std::make_unique<sdbusplus::bus::match::match>(
521 static_cast<sdbusplus::bus::bus&>(*systemBus),
522 "type='signal',member='PropertiesChanged',path_namespace='" +
Jae Hyun Yoo9ced0a32018-10-25 10:42:39 -0700523 std::string(inventoryPath) + "',arg0namespace='" + type + "'",
James Feist6714a252018-09-10 15:26:18 -0700524 eventHandler);
525 matches.emplace_back(std::move(match));
526 }
527
James Feistdc6c55f2018-10-31 12:53:20 -0700528 // redundancy sensor
529 std::function<void(sdbusplus::message::message&)> redundancyHandler =
530 [&tachSensors, &systemBus,
James Feistb6c0b912019-07-09 12:21:44 -0700531 &objectServer](sdbusplus::message::message&) {
James Feistdc6c55f2018-10-31 12:53:20 -0700532 createRedundancySensor(tachSensors, systemBus, objectServer);
533 };
534 auto match = std::make_unique<sdbusplus::bus::match::match>(
535 static_cast<sdbusplus::bus::bus&>(*systemBus),
536 "type='signal',member='PropertiesChanged',path_namespace='" +
537 std::string(inventoryPath) + "',arg0namespace='" +
538 redundancyConfiguration + "'",
James Feistb6c0b912019-07-09 12:21:44 -0700539 std::move(redundancyHandler));
James Feistdc6c55f2018-10-31 12:53:20 -0700540 matches.emplace_back(std::move(match));
541
James Feist6714a252018-09-10 15:26:18 -0700542 io.run();
543}