render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
d76c62
From f4c935bfa5bd3e4f4856dfdf660be0fa50d42798 Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <f4c935bfa5bd3e4f4856dfdf660be0fa50d42798@dist-git>
d76c62
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
d76c62
Date: Mon, 10 Feb 2020 17:05:54 +0100
d76c62
Subject: [PATCH] qemu: preserve error on bandwidth rollback
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
We call APIs that reset the error in the rollback code.
d76c62
Preserve the error from the original call that failed.
d76c62
d76c62
This turns the boringly cryptic:
d76c62
  error: Unable to set interface parameters
d76c62
  error: An error occurred, but the cause is unknown
d76c62
to the unexpectedly anarchist:
d76c62
  error: internal error: Child process (/usr/sbin/tc filter add
d76c62
  dev vnet1 parent ffff: protocol all u32 match u32 0 0 police
d76c62
  rate 4294968kbps burst 4294968kb mtu 64kb drop flowid :1)
d76c62
  unexpected exit status 1: Illegal "rate"
d76c62
  Illegal "police"
d76c62
d76c62
Signed-off-by: Ján Tomko <jtomko@redhat.com>
d76c62
Fixes: f02e21cb3379a41cd42f2d8116f2d10dabace83b
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1800505
d76c62
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
d76c62
(cherry picked from commit 457b0e74888f61b759e334d91479c258663835d5)
d76c62
Signed-off-by: Ján Tomko <jtomko@redhat.com>
d76c62
Message-Id: <a49ef696966d8b8ca28d298ffab16c3a77b1102a.1581350626.git.jtomko@redhat.com>
d76c62
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
d76c62
---
d76c62
 src/qemu/qemu_driver.c | 4 ++++
d76c62
 1 file changed, 4 insertions(+)
d76c62
d76c62
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
d76c62
index 08f492fa24..af81c4a6e4 100644
d76c62
--- a/src/qemu/qemu_driver.c
d76c62
+++ b/src/qemu/qemu_driver.c
d76c62
@@ -11642,6 +11642,9 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
d76c62
 
d76c62
         if (virNetDevBandwidthSet(net->ifname, newBandwidth, false,
d76c62
                                   !virDomainNetTypeSharesHostView(net)) < 0) {
d76c62
+            virErrorPtr orig_err;
d76c62
+
d76c62
+            virErrorPreserveLast(&orig_err);
d76c62
             ignore_value(virNetDevBandwidthSet(net->ifname,
d76c62
                                                net->bandwidth,
d76c62
                                                false,
d76c62
@@ -11650,6 +11653,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
d76c62
                 ignore_value(virDomainNetBandwidthUpdate(net,
d76c62
                                                          net->bandwidth));
d76c62
             }
d76c62
+            virErrorRestore(&orig_err);
d76c62
             goto endjob;
d76c62
         }
d76c62
 
d76c62
-- 
d76c62
2.25.0
d76c62