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

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