render / rpms / libvirt

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