add logs for veth creation
Change-Id: I429eb3e20e1681bc0809274990c147bf817c686b
diff --git a/core/core_server.go b/core/core_server.go
index 964d704..841bf24 100644
--- a/core/core_server.go
+++ b/core/core_server.go
@@ -265,6 +265,7 @@
s.wg.Add(1)
ioinfos, veths, err := createIoinfos(s.Olt.ID, s.Vethnames, s.Onumap)
if err != nil {
+ logger.Error("createIoinfos failed.", err)
return err
}
s.Ioinfos = ioinfos
@@ -276,6 +277,7 @@
s.cancel = cancel
if err = s.runPacketInDaemon(child, stream); err != nil {
+ logger.Error("runPacketInDaemon failed.", err)
return err
}
return nil
@@ -298,6 +300,7 @@
onuid := onumap[intfid][i].OnuID
uniup, unidw := makeUniName(oltid, intfid, onuid)
if handler, Vethnames, err = setupVethHandler(uniup, unidw, Vethnames); err != nil {
+ logger.Error("setupVethHandler failed (onuid: %d)", onuid, err)
return ioinfos, Vethnames, err
}
iinfo := Ioinfo{Name: uniup, iotype: "uni", ioloc: "inside", intfid: intfid, onuid: onuid, handler: handler}
@@ -310,6 +313,7 @@
var handler *pcap.Handle
nniup, nnidw := makeNniName(oltid)
if handler, Vethnames, err = setupVethHandler(nniup, nnidw, Vethnames); err != nil {
+ logger.Error("setupVethHandler failed for nni", err)
return ioinfos, Vethnames, err
}
diff --git a/core/io_worker.go b/core/io_worker.go
index 2657e4c..8524866 100644
--- a/core/io_worker.go
+++ b/core/io_worker.go
@@ -160,11 +160,13 @@
err1 := CreateVethPairs(inveth, outveth)
vethnames = append(vethnames, inveth)
if err1 != nil {
+ logger.Error("setupVethHandler failed", err1)
RemoveVeths(vethnames)
return nil, vethnames, err1
}
handler, err2 := getVethHandler(inveth)
if err2 != nil {
+ logger.Error("getVethHandler failed", err2)
RemoveVeths(vethnames)
return nil, vethnames, err2
}