From nobody Sat May 4 15:09:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1555474300; cv=none; d=zoho.com; s=zohoarc; b=Nt2eB5gGym8Jm10030gfUi5++JFx/6PbkYgS0QrKELYCETFyAblYzn4wmpbePmtZ4HAQgPhSYLx+gOD90rNOoyq19E22GzP5sGv2apgdQQMIJP6hlBgpX3fCFDIZr2Hb3LCl/PRkUhhz4aRKgJdpyQT2VO5s1E+OHBzCzz0nRY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555474300; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=wdsH1f5Dm4QLthw9wLln5eGsYp/U2ErrMPMIESorsPQ=; b=hj2/8FTtKyif9jSlpTjS3vJxq/+C6eA4IzZONDxIMAkQ2nsiS+cENvtJ+X8ipTG+1t8EPSKCQL1sXZbpSnq4C0g+6ezl4r69YvNDGq/PMctIcFkdtovC+2CwrSDpc0Kt9pPETkIBJMlH+E+P7qO8h14g2PqcPbHnwGRC2OcHBgA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1555474300787384.2990874301365; Tue, 16 Apr 2019 21:11:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 323DA308339E; Wed, 17 Apr 2019 04:11:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A4F45C1B5; Wed, 17 Apr 2019 04:11:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2FAF0181AC45; Wed, 17 Apr 2019 04:11:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3H4BRLL012711 for ; Wed, 17 Apr 2019 00:11:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 745BF60C64; Wed, 17 Apr 2019 04:11:27 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E70360C43 for ; Wed, 17 Apr 2019 04:11:25 +0000 (UTC) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CC7881F11 for ; Wed, 17 Apr 2019 04:11:24 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id bf11so11357497plb.12 for ; Tue, 16 Apr 2019 21:11:24 -0700 (PDT) Received: from DESKTOP-N43DQQ0.access.network ([5.32.57.218]) by smtp.googlemail.com with ESMTPSA id p26sm133148356pfa.49.2019.04.16.21.11.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 21:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6dvonY+U/VHYacxXcdIvJGHCRzJnu6GeXO0v5Dux4qE=; b=BpTAibrGQ5kk4keJJaMeBeGz+lxRGWniZEgBFqk5h0akme0N3t5XpTw47f2aQFfGAg QsOx+zKDKzTdFxF+tPK/CE46qvHwlEMzNZSGO98/c+TTsgmr7GbMeOHPUdeoBH0J4Q6A jMBGWWSkk9OeoETfhltv9+wzK3jjQysko4eN+maKnj/ulXsnHskiFGGDFm8qoc1xeDSB xSugbswATs2wS6y+JBldwLy0/TG14dEOR8MAFXq+IZH3q18NKQ8kn41NCBSuOVx2zsqB LEdw4a7Jf7HRqSQBbBmbJBuzrS5/DxGwOZMZ+j79lU4e3EWIkjVSdu59pcfok3IlvN5D A9Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6dvonY+U/VHYacxXcdIvJGHCRzJnu6GeXO0v5Dux4qE=; b=FCtbG3h0bcbKj/D3dB5aHvFcn2mhc53nozHFtl/C9GeDz7c306S+0h6Sez7nTR2MTF vWKBRpFYsdCo3psGQgx74DnLGrpFIdUSEfGwDLW5tRoxu6DFwY8CJjAtGjclc/v0tDGg 5ufzfzsy9FLIaThfVPZo72FWtPEr6XPgwBbKpBZe9uWdk79+WcrgGcm24Dj8k7O1WOtN sxbX/je/denHcVQnlnrnUFdTODFZpR7jyzb+lGz3kProBU4IXlrDDOeHCXhXCM/Roqv3 obWy7tAdB7eNDyPgSEgcWypvMpC79hsRuFsPiv6j6aRK5gQs1EeO+GcaXD94I4n7N/Kc YvtQ== X-Gm-Message-State: APjAAAVzewVeWVj/1/quAfgJQOTV3zFFcsek4dvw44x+YoMSmFV82ctG IVVMxgY4Q0365tqCDNrS+G9+IgTRBXw= X-Google-Smtp-Source: APXvYqwv0yKQoNItezvOjy39vwpo/hhUSGJ8ZX0wa3u+Yox1/Vp+zCWvkeQ0+FSIylUB2BnOOoY88w== X-Received: by 2002:a17:902:e01:: with SMTP id 1mr87342094plw.128.1555474283608; Tue, 16 Apr 2019 21:11:23 -0700 (PDT) From: Syed Humaid To: libvir-list@redhat.com Date: Wed, 17 Apr 2019 08:11:06 +0400 Message-Id: <20190417041106.274-1-syedhumaidbinharoon@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 17 Apr 2019 04:11:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 17 Apr 2019 04:11:24 +0000 (UTC) for IP:'209.85.214.195' DOMAIN:'mail-pl1-f195.google.com' HELO:'mail-pl1-f195.google.com' FROM:'syedhumaidbinharoon@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.108 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.214.195 mail-pl1-f195.google.com 209.85.214.195 mail-pl1-f195.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Syed Humaid Subject: [libvirt] [PATCH v1] network: Convert to virErrorRestore/virErrorPreserveLast X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 17 Apr 2019 04:11:37 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Replaced usage of virSaveLastError and virSetError/virFreeError with=20 virErrorPreserveLast and virErrorRestore respectively. Signed-off-by: Syed Humaid --- src/network/bridge_driver.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index f824b8b4f3..dc21ac642c 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2495,7 +2495,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, =20 err4: if (!save_err) - save_err =3D virSaveLastError(); + virErrorPreserveLast(&save_err); =20 dnsmasqPid =3D virNetworkObjGetDnsmasqPid(obj); if (dnsmasqPid > 0) { @@ -2505,18 +2505,18 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, =20 err3: if (!save_err) - save_err =3D virSaveLastError(); + virErrorPreserveLast(&save_err); ignore_value(virNetDevSetOnline(def->bridge, 0)); =20 err2: if (!save_err) - save_err =3D virSaveLastError(); + virErrorPreserveLast(&save_err); if (def->forward.type !=3D VIR_NETWORK_FORWARD_OPEN) networkRemoveFirewallRules(def); =20 err1: if (!save_err) - save_err =3D virSaveLastError(); + virErrorPreserveLast(&save_err); =20 if (macTapIfName) { VIR_FORCE_CLOSE(tapfd); @@ -2528,13 +2528,10 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, =20 err0: if (!save_err) - save_err =3D virSaveLastError(); + virErrorPreserveLast(&save_err); ignore_value(virNetDevBridgeDelete(def->bridge)); =20 - if (save_err) { - virSetError(save_err); - virFreeError(save_err); - } + virErrorRestore(&save_err); /* coverity[leaked_handle] - 'tapfd' is not leaked */ return -1; } --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list