From: Jinsheng Zhang Date: Tue, 17 Aug 2021 04:38:15 +0000 (+0800) Subject: virnetdevopenvswitch: Fix qos cleaning residual on multi interfaces X-Git-Tag: v7.7.0-rc1~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47437bbe3a0e3ae5b98b25f3bbf11368845ef279;p=thirdparty%2Flibvirt.git 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 --- 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; }