From c2028d3b27e20eb0d15a553139d2c987325d977e Mon Sep 17 00:00:00 2001
From: Gaurav Agrawal <agrawalgaurav(a)gnome.org>
Date: Mon, 24 Feb 2020 22:49:21 +0530
Subject: [PATCH] network: bridge_driver: Use new helpers for storing libvirt
errors
Signed-off-by: Gaurav Agrawal <agrawalgaurav(a)gnome.org>
---
src/network/bridge_driver_linux.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/network/bridge_driver_linux.c
b/src/network/bridge_driver_linux.c
index 7bbde5c6a9..fde33b5d38 100644
--- a/src/network/bridge_driver_linux.c
+++ b/src/network/bridge_driver_linux.c
@@ -22,6 +22,7 @@
#include <config.h>
#include "viralloc.h"
+#include "virerror.h"
#include "virfile.h"
#include "viriptables.h"
#include "virstring.h"
@@ -53,7 +54,7 @@ static void networkSetupPrivateChains(void)
if (rc < 0) {
VIR_DEBUG("Failed to create global IPv4 chains: %s",
virGetLastErrorMessage());
- errInitV4 = virSaveLastError();
+ virErrorPreserveLast(&errInitV4);
virResetLastError();
} else {
virFreeError(errInitV4);
@@ -70,7 +71,7 @@ static void networkSetupPrivateChains(void)
if (rc < 0) {
VIR_DEBUG("Failed to create global IPv6 chains: %s",
virGetLastErrorMessage());
- errInitV6 = virSaveLastError();
+ virErrorPreserveLast(&errInitV6);
virResetLastError();
} else {
virFreeError(errInitV6);
--
2.24.1