From 47437bbe3a0e3ae5b98b25f3bbf11368845ef279 Mon Sep 17 00:00:00 2001 From: Jinsheng Zhang Date: Tue, 17 Aug 2021 12:38:15 +0800 Subject: [PATCH] virnetdevopenvswitch: Fix qos cleaning residual on multi interfaces Warn these error instead of return when removing qos or queues. This will avoid residual qos clearance on multiple interfaces. Signed-off-by: zhangjl02 Reviewed-by: Michal Privoznik --- src/util/virnetdevopenvswitch.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index 8a89b717e7..8955f0fa66 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -824,6 +824,7 @@ int virNetDevOpenvswitchInterfaceClearTxQos(const char *ifname, const unsigned char *vmuuid) { + int ret = 0; char vmuuidstr[VIR_UUID_STRING_BUFLEN]; g_autoptr(virCommand) cmd = NULL; g_autofree char *ifname_ex_id = NULL; @@ -871,9 +872,8 @@ virNetDevOpenvswitchInterfaceClearTxQos(const char *ifname, cmd = virNetDevOpenvswitchCreateCmd(); virCommandAddArgList(cmd, "destroy", "qos", line, NULL); if (virCommandRun(cmd, NULL) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to destroy qos on port %s"), ifname); - return -1; + VIR_WARN("Unable to destroy qos on port %s", ifname); + ret = -1; } } } @@ -890,14 +890,13 @@ virNetDevOpenvswitchInterfaceClearTxQos(const char *ifname, cmd = virNetDevOpenvswitchCreateCmd(); virCommandAddArgList(cmd, "destroy", "queue", line, NULL); if (virCommandRun(cmd, NULL) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to destroy queue on port %s"), ifname); - return -1; + VIR_WARN("Unable to destroy queue on port %s", ifname); + ret = -1; } } } - return 0; + return ret; } int @@ -912,7 +911,7 @@ virNetDevOpenvswitchInterfaceClearRxQos(const char *ifname) if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to set vlan configuration on port %s"), ifname); + _("Unable to reset ingress on port %s"), ifname); return -1; } -- 2.47.2