From 3f431076761958a67b83264fcac5fe8a12654166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96rjan=20Fors?= Date: Thu, 7 Sep 2017 09:39:12 +0200 Subject: [PATCH] Check error when reading the dnsmasq lease status --- kvm.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kvm.go b/kvm.go index 1e6c89156e7..e5cf5dafba7 100644 --- a/kvm.go +++ b/kvm.go @@ -633,6 +633,10 @@ func (d *Driver) getIPByMacFromSettings(mac string) (string, error) { } statusFile := fmt.Sprintf(dnsmasqStatus, bridge_name) data, err := ioutil.ReadFile(statusFile) + if err != nil { + log.Warnf("Failed to read dnsmasq lease status: %s", err) + return "", err + } type Lease struct { Ip_address string `json:"ip-address"` Mac_address string `json:"mac-address"`