Laine Stump 9a08168301 util: restructure virNetDevReadNetConfig() to eliminate false error logs
virHostdevRestoreNetConfig() calls virNetDevReadNetConfig() to try and
read the "original config" of a netdev, and if that fails, it tries
again with a different directory/netdev name. This achieves the
desired effect (we end up finding the config wherever it may be), but
for each failure, virNetDevReadNetConfig() places a nice error message
in the system logs. Experience has shown that false-positive error
logs like this lead to erroneous bug reports, and can often mislead
those searching for *real* bugs.

This patch changes virNetDevReadNetConfig() to explicitly check if the
file exists before calling virFileReadAll(); if it doesn't exist,
virNetDevReadNetConfig() returns a success, but leaves all the
variables holding the results as NULL. (This makes sense if you define
the purpose of the function as "read a netdev's config from its config
file *if that file exists*).

To take advantage of that change, the caller,
virHostdevRestoreNetConfig() is modified to fail immediately if
virNetDevReadNetConfig() returns an error, and otherwise to try the
different directory/netdev name if adminMAC & vlan & MAC are all NULL
after the preceding attempt.
2017-08-11 19:09:49 -04:00
..
2017-04-28 14:17:10 +02:00
2016-06-16 06:17:58 -04:00
2017-08-08 12:19:17 +02:00
2017-08-08 12:19:17 +02:00
2017-05-02 17:27:13 +01:00
2016-11-23 12:08:15 -05:00
2016-06-16 13:09:19 -04:00
2017-01-25 09:18:49 +01:00
2017-05-26 20:00:51 +04:00
2017-07-26 15:31:25 +02:00
2017-07-26 15:31:25 +02:00
2017-01-04 12:47:01 +01:00
2017-05-16 16:48:30 +02:00
2017-06-12 19:11:30 -04:00
2016-08-02 14:20:31 +02:00
2016-08-02 14:20:31 +02:00
2017-04-27 14:13:19 +02:00
2016-10-13 17:58:56 +08:00
2016-07-28 08:27:13 -04:00
2017-06-14 15:01:42 +01:00
2016-12-06 13:33:18 +01:00
2017-03-22 09:01:32 +01:00
2017-04-13 08:14:54 -04:00
2016-11-23 12:08:15 -05:00
2016-12-15 09:25:16 +01:00
2016-12-06 13:33:18 +01:00