render / rpms / libvirt

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