]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virnetdevopenvswitch: Fix qos cleaning residual on multi interfaces
authorJinsheng Zhang <zhangjl02@inspur.com>
Tue, 17 Aug 2021 04:38:15 +0000 (12:38 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 19 Aug 2021 14:47:40 +0000 (16:47 +0200)
Warn these error instead of return when removing qos or queues. This will
avoid residual qos clearance on multiple interfaces.

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virnetdevopenvswitch.c

index 8a89b717e7dc28974cf50fda924d3cc92b934334..8955f0fa6680a53211fee950126857d68362cc9e 100644 (file)
@@ -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;
     }