From nobody Sat May 18 04:13:31 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=1555440690; cv=none; d=zoho.com; s=zohoarc; b=LKlm/Gz+JNaTQ3TxjruK3WM41DsAmBCQ2wLTZZraWKQz8qsCCTvvkuw8Zn5IZ9Rr4wPAhCOB1UqLBBFitgAjzf7FBmiWTxYO0iJIMb5Ab/thvxRsDGazb5xRr/O8DkEuXg6CtAHzhW1Drx6cKPxUJ6NePoqMOyc1WRxzAjW7XFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555440690; 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=6F2QxSQMtS/J3Cfu/1bC1Az8kGHg3mRwtLjMTmJbgYg=; b=mFMpGdTlLoLpSGBIGdNSAzRE8OUy2aCTVeu7sFnKqRhtLLBYieJHP8IvmpPMCfIKQZPu6EqZdtu0SvruuA1tNA2pKvMpajs9KHOlfftbmUaKxVtzKevK78Wmr9q6KhBxDjYvjPpr1yxZxRWARGRLrLeYizwET59dB9oEsHcqSvM= 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 1555440690046280.7717134240536; Tue, 16 Apr 2019 11:51:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2862C05242C; Tue, 16 Apr 2019 18:51:27 +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 A5BEE608C2; Tue, 16 Apr 2019 18:51:25 +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 50C9E181AC45; Tue, 16 Apr 2019 18:51:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3GIpKFM011533 for ; Tue, 16 Apr 2019 14:51:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8ED055D71C; Tue, 16 Apr 2019 18:51:20 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 891E95D71A for ; Tue, 16 Apr 2019 18:51:17 +0000 (UTC) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 7925F3092657 for ; Tue, 16 Apr 2019 18:51:16 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id l7so20070144ljg.6 for ; Tue, 16 Apr 2019 11:51:16 -0700 (PDT) Received: from localhost.localdomain ([5.193.35.62]) by smtp.googlemail.com with ESMTPSA id q11sm397889lfc.51.2019.04.16.11.51.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 11:51:13 -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=8ORayz+xrzMpMZj9CAzRGre8ZFh4UeC0+yPmzmKn5sc=; b=UZE4hoPGQ3QLEIjRCCOMbMjG5DguQA8spKZwD5sa21nSOPXWbAW6k8/NMm/P6fjcci Ue6reC3xIHh1boxxkL0kwdLK5y0ktL+G0AB2/ssxIAI1XaWv9wA5eaOWf67djnbx+KDD h5KFOw7xP7wpgMQW5jUj5WcvMQ4sdW8hq5uTaQOnS6C6GtZZxHljokLrEuwVaciTu1qs S263rx5b5N4WZ0FT7hQBoIAMmgzakgH0ce1b7eZ+VpHC1gEf/b9GgJzV1eVwFGHjqUiY U1gfCijB9bF/h+EToKYOwaZd8Eb5P9ZcnqPCIeMDxszuiBQdLdLWmZtBApGQ9uqWVcdF 9LBg== 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=8ORayz+xrzMpMZj9CAzRGre8ZFh4UeC0+yPmzmKn5sc=; b=sC+xDQhB9BddGViLTV9IuFcK2xrEkIgk3XYxKJnQVdjbWFzSSJ8dJYlOnJQsXau8VK KKYdXy+xg4yp76dyTMpljUdJKST/84jBRsoPqMxVK9/SpchQgfQcGhdoDgS7xNeVQUKq mAXzhV3xS6q4sdX9gZ9jEYwNYqR6nPMOz1nJmxpvunY2AN59zAxZHtj6FXFzdNC+UGl+ 4VXZ5SdA905j+blmtXxQO3FaVTGQPt3pxOnITIGPlj8ibOAx4vVEJnnHTAxfspRR57Zt GMXcv4j6oPO9rdIjt/TJjtVM+G+HkPqHCA0/q//pJJvrlnH+v1+889HVmr2BZj1e7Us8 0mGQ== X-Gm-Message-State: APjAAAWiR3Oew4JcSzFyO2K3vxjzaEbj9N8Vew4LPdg4cV4TyQqZWatc IOv1TyEbaDUfwVew9BWei6y6GUYpnMU= X-Google-Smtp-Source: APXvYqyDyMnh4yJ3MYcxgVzIhCaGtNj+1vkkfw4cPgcuCDlT9htFGmufZUaPJOVrv2R7l72f0cgl1Q== X-Received: by 2002:a2e:2b16:: with SMTP id q22mr47735891lje.20.1555440674560; Tue, 16 Apr 2019 11:51:14 -0700 (PDT) From: Syed Humaid To: libvir-list@redhat.com Date: Tue, 16 Apr 2019 22:51:01 +0400 Message-Id: <20190416185101.365-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.43]); Tue, 16 Apr 2019 18:51:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 16 Apr 2019 18:51:16 +0000 (UTC) for IP:'209.85.208.194' DOMAIN:'mail-lj1-f194.google.com' HELO:'mail-lj1-f194.google.com' FROM:'syedhumaidbinharoon@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.12 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.208.194 mail-lj1-f194.google.com 209.85.208.194 mail-lj1-f194.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Syed Humaid Subject: [libvirt] [PATCH v3] libvirt-domain.c: 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 16 Apr 2019 18:51:28 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Replaced all virSaveLastError and virSetError/virFreeError usages to virErrorPreserveLast and virErrorRestore respectively. Signed-off-by: Syed Humaid --- src/libvirt-domain.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index baf21824fe..80284a99f0 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -2894,7 +2894,7 @@ virDomainMigrateVersion2(virDomainPtr domain, _("domainMigratePrepare2 did not set uri")); cancelled =3D 1; /* Make sure Finish doesn't overwrite the error */ - orig_err =3D virSaveLastError(); + virErrorPreserveLast(&orig_err); goto finish; } if (uri_out) @@ -2909,7 +2909,7 @@ virDomainMigrateVersion2(virDomainPtr domain, =20 /* Perform failed. Make sure Finish doesn't overwrite the error */ if (ret < 0) - orig_err =3D virSaveLastError(); + virErrorPreserveLast(&orig_err); =20 /* If Perform returns < 0, then we need to cancel the VM * startup on the destination @@ -2929,10 +2929,7 @@ virDomainMigrateVersion2(virDomainPtr domain, VIR_ERROR(_("finish step ignored that migration was cancelled")); =20 done: - if (orig_err) { - virSetError(orig_err); - virFreeError(orig_err); - } + virErrorRestore(&orig_err); VIR_FREE(uri_out); VIR_FREE(cookie); return ddomain; @@ -3076,7 +3073,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, /* Begin already started a migration job so we need to cancel = it by * calling Confirm while making sure it doesn't overwrite the = error */ - orig_err =3D virSaveLastError(); + virErrorPreserveLast(&orig_err); goto confirm; } else { goto done; @@ -3091,7 +3088,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, VIR_MIGRATE_PARAM_URI, uri_out) < 0) { cancelled =3D 1; - orig_err =3D virSaveLastError(); + virErrorPreserveLast(&orig_err); goto finish; } } else if (!uri && @@ -3100,7 +3097,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("domainMigratePrepare3 did not set uri")); cancelled =3D 1; - orig_err =3D virSaveLastError(); + virErrorPreserveLast(&orig_err); goto finish; } =20 @@ -3136,7 +3133,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, =20 /* Perform failed. Make sure Finish doesn't overwrite the error */ if (ret < 0) { - orig_err =3D virSaveLastError(); + virErrorPreserveLast(&orig_err); /* Perform failed so we don't need to call confirm to let source k= now * about the failure. */ @@ -3222,7 +3219,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, * one we need to preserve it in case confirm3 overwrites */ if (!orig_err) - orig_err =3D virSaveLastError(); + virErrorPreserveLast(&orig_err); =20 confirm: /* @@ -3256,10 +3253,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, } =20 done: - if (orig_err) { - virSetError(orig_err); - virFreeError(orig_err); - } + virErrorRestore(&orig_err); VIR_FREE(dom_xml); VIR_FREE(uri_out); VIR_FREE(cookiein); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list