The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/3949

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <[email protected]>
From d9853bdf9a67d55ced45c6f52b9e9f22917b0a92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]>
Date: Tue, 17 Oct 2017 00:01:05 -0400
Subject: [PATCH] resources: Deal with missing cpufreq directory
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <[email protected]>
---
 lxd/util/resources.go | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lxd/util/resources.go b/lxd/util/resources.go
index 4556eebc0..6487e4f07 100644
--- a/lxd/util/resources.go
+++ b/lxd/util/resources.go
@@ -197,19 +197,23 @@ func parseSysDevSystemCpu() ([]thread, error) {
                path = 
fmt.Sprintf("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq", t.ID)
                freq, err := parseNumberFromFile(path)
                if err != nil {
-                       return nil, err
+                       if !os.IsNotExist(err) {
+                               return nil, err
+                       }
+               } else {
+                       t.frequency = uint64(freq / 1000)
                }
 
-               t.frequency = uint64(freq / 1000)
-
                path = 
fmt.Sprintf("/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", t.ID)
                freq, err = parseNumberFromFile(path)
                if err != nil {
-                       return nil, err
+                       if !os.IsNotExist(err) {
+                               return nil, err
+                       }
+               } else {
+                       t.frequencyTurbo = uint64(freq / 1000)
                }
 
-               t.frequencyTurbo = uint64(freq / 1000)
-
                threads = append(threads, t)
        }
 
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to