render / rpms / libvirt

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