Comment 5 for bug 1481295

Revision history for this message
Thomas Bruno (tebruno99) wrote :

Putthing this in debian/patch/fix-virtmanager and adding fix-virtmanager to debian/patch/series solved this issue:

diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index a3b0176..5d69d19 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -1041,7 +1041,14 @@ static void add_link_info(struct netcf *ncf,
     ERR_NOMEM(!path, ncf);
     state = read_file(path, &length);
     FREE(path);
- ERR_THROW_STRERROR(!state, ncf, EFILE, "Failed to read %s", path);
+ if (!state) {
+ /* missing operstate is *not* an error. It could be due to an
+ * alias interface, which has not entry in /sys/class/net at
+ * all, for example.
+ */
+ state = strdup("");
+ ERR_NOMEM(!state, ncf);
+ }
     if ((nl = strchr(state, '\n')))
         *nl = 0;
     prop = xmlSetProp(link_node, BAD_CAST "state", BAD_CAST state);