From ac5dbd8598abd7ccae6f7c3b0085d03ddee44355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 26 May 2022 12:23:01 +0200 Subject: [PATCH] clh: Improve logging related to the net dev addition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's improve the log so we make it clear that we're only *actually* adding the net device to the Cloud Hypervisor configuration when calling our own version of VmAddNetPut(). Signed-off-by: Fabiano FidĂȘncio --- src/runtime/virtcontainers/clh.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/virtcontainers/clh.go b/src/runtime/virtcontainers/clh.go index 23a16f46f1..ce8f8fa577 100644 --- a/src/runtime/virtcontainers/clh.go +++ b/src/runtime/virtcontainers/clh.go @@ -161,6 +161,8 @@ var vmAddNetPutRequest = func(clh *cloudHypervisor) error { defer conn.Close() for _, netDevice := range *clh.netDevices { + clh.Logger().Infof("Adding the net device to the Cloud Hypervisor VM configuration: %+v", netDevice) + netDeviceAsJson, err := json.Marshal(netDevice) if err != nil { return err @@ -1465,10 +1467,6 @@ func (clh *cloudHypervisor) addNet(e Endpoint) error { } clh.netDevicesFiles[mac] = netPair.TapInterface.VMFds - clh.Logger().WithFields(log.Fields{ - "mac": mac, - }).Info("Adding Net") - netRateLimiterConfig := clh.getNetRateLimiterConfig() net := chclient.NewNetConfig() @@ -1483,6 +1481,8 @@ func (clh *cloudHypervisor) addNet(e Endpoint) error { clh.netDevices = &[]chclient.NetConfig{*net} } + clh.Logger().Infof("Storing the Cloud Hypervisor network configuration: %+v", net) + return nil }