Blame SOURCES/libvirt-qemu-hotplug-don-t-overwrite-error-message-in-qemuDomainAttachNetDevice.patch

edecca
From 60696c94a10c41997fe44478a3551dce50d29233 Mon Sep 17 00:00:00 2001
edecca
Message-Id: <60696c94a10c41997fe44478a3551dce50d29233@dist-git>
edecca
From: Katerina Koukiou <kkoukiou@redhat.com>
edecca
Date: Mon, 16 Jul 2018 11:20:56 +0200
edecca
Subject: [PATCH] qemu: hotplug: don't overwrite error message in
edecca
 qemuDomainAttachNetDevice
edecca
MIME-Version: 1.0
edecca
Content-Type: text/plain; charset=UTF-8
edecca
Content-Transfer-Encoding: 8bit
edecca
edecca
Since commit f14c37, virDomainConfVMNWFilterTeardown is reporting errors
edecca
thus any previously reported error gets overwritten.
edecca
We need to save the errors in qemuDomainAttachNetDevice before calling
edecca
this function when we are in cleanup code.
edecca
edecca
https://bugzilla.redhat.com/show_bug.cgi?id=1598311
edecca
edecca
Signed-off-by: Katerina Koukiou <kkoukiou@redhat.com>
edecca
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
edecca
(cherry picked from commit f7b55665cc6b805bc4c34e1ec5908df31084ef5c)
edecca
Signed-off-by: Katerina Koukiou <kkoukiou@redhat.com>
edecca
Reviewed-by: Ján Tomko <jtomko@redhat.com>
edecca
---
edecca
 src/qemu/qemu_hotplug.c | 3 +++
edecca
 1 file changed, 3 insertions(+)
edecca
edecca
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
edecca
index 456bfa4493..3d0f1055d9 100644
edecca
--- a/src/qemu/qemu_hotplug.c
edecca
+++ b/src/qemu/qemu_hotplug.c
edecca
@@ -790,6 +790,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
edecca
     bool charDevPlugged = false;
edecca
     bool netdevPlugged = false;
edecca
     char *netdev_name;
edecca
+    virErrorPtr save_error = NULL;
edecca
 
edecca
     /* preallocate new slot for device */
edecca
     if (VIR_REALLOC_N(vm->def->nets, vm->def->nnets + 1) < 0)
edecca
@@ -1071,7 +1072,9 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
edecca
             qemuDomainReleaseDeviceAddress(vm, &net->info, NULL);
edecca
 
edecca
         if (iface_connected) {
edecca
+            virErrorPreserveLast(&save_error);
edecca
             virDomainConfNWFilterTeardown(net);
edecca
+            virErrorRestore(&save_error);
edecca
 
edecca
             if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT) {
edecca
                 ignore_value(virNetDevMacVLanDeleteWithVPortProfile(
edecca
-- 
edecca
2.18.0
edecca