From nobody Sun May 5 20:40:29 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155453677087837.28193946869351; Sat, 6 Apr 2019 00:46:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32B5E356CF; Sat, 6 Apr 2019 07:46:07 +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 A27E1177BC; Sat, 6 Apr 2019 07:46:04 +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 62AA1181AC43; Sat, 6 Apr 2019 07:45:59 +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 x367jknq011596 for ; Sat, 6 Apr 2019 03:45:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id B1A6960F87; Sat, 6 Apr 2019 07:45:46 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ACCF960CD1 for ; Sat, 6 Apr 2019 07:45:44 +0000 (UTC) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.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 0F534356CF for ; Sat, 6 Apr 2019 07:45:43 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id v13so7106752ljk.4 for ; Sat, 06 Apr 2019 00:45:42 -0700 (PDT) Received: from localhost.localdomain ([5.193.1.33]) by smtp.googlemail.com with ESMTPSA id q17sm4861503lfb.13.2019.04.06.00.45.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Apr 2019 00:45:40 -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=xGZ641nHZ6dXctGshsW89P6qirvc19LTURDWyBL95uM=; b=nCFsZn+hJ3jt68wvv+I1fQqbs/SCxchb2B21BCP66wxNysC8lERNxCxksjKKCulxCS 673BAbjsIR/KsoK3+tIu7FGK8PnTioj4NT8mcgITBdqZxtDnzWXI4wAVwvC3DZ1uU/Z6 5QuAYzjLYLIEUiRyc51iWHOUF1DhB21VpFNqTR0fW5jAinPhdoobl7tIG5EBJ4mJRubZ 4uR80HTvwr9t64ZFIw3HFCoRQWfj0gMfOasB2VVJTmkEHimZdW80aD7SSrErNcrkI+0s G5eiw0V24wx5X/UYtHlhKPM6P4Ae6/prqIyknsmdIYo7oFkSaLibTCo+/MDj9pzO7qaU de6Q== 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=xGZ641nHZ6dXctGshsW89P6qirvc19LTURDWyBL95uM=; b=fbotRr6mb1oxKkN3MMDVGWb0W0P/NlK6nSksrTVjfFys8GGdZTuIdAwXDm2aLUOu7Z WjxI78X9sLKIzukmcnsPC3173OI+xAxxk7WDO1cuFat299GUbgg2uTHxBss83TGCDjfd X3H7Eruy0+U6zZJXFNLuoqjb3J1/9eI4aazTUbjRqsvk5drRP7dC05/2RH63rvFNH8th Usi4nz9g9CraDt9xmqX0wUYbrmxr1cpHq4YDMfvrShrmhJlcBPPgAAajbWOhiIJt+M0c UG1DOgmIBKmVWj7Y2KUpcJkp6kKUFqYwgr0BLAwjAubYaHVCp2OXNYVOUExzPpus9Orq t+lw== X-Gm-Message-State: APjAAAUDH4FSjAPMmSmkuA9Mn93y5umBL+WU4L0qDTCz2o9h7nIuvX6Z lK7eBA++qeCWrMhnxkTWpk9Cq7uI X-Google-Smtp-Source: APXvYqyHByUDp3nWt4jw1BUozWQ0bWjwJKtcGvgWN7Q+VNeqXVkMsb7JJt1mcKnlZy4dw3wCo8IJMg== X-Received: by 2002:a2e:5c7:: with SMTP id 190mr9311319ljf.108.1554536741181; Sat, 06 Apr 2019 00:45:41 -0700 (PDT) From: Syed Humaid To: libvir-list@redhat.com Date: Sat, 6 Apr 2019 11:45:10 +0400 Message-Id: <20190406074510.455-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.30]); Sat, 06 Apr 2019 07:45:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 06 Apr 2019 07:45:43 +0000 (UTC) for IP:'209.85.208.195' DOMAIN:'mail-lj1-f195.google.com' HELO:'mail-lj1-f195.google.com' FROM:'syedhumaidbinharoon@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.208.195 mail-lj1-f195.google.com 209.85.208.195 mail-lj1-f195.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Syed Humaid Subject: [libvirt] [PATCH] virErrorPreserveLast/virErrorRestore conversions 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 06 Apr 2019 07:46:08 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" As per the suggestions regarding the previous patch for virErrorPreserveLast conversions, I have converted all instances to virErrorPreserveLast and virErrorRestore. Signed-off-by: Syed Humaid --- src/libvirt-domain.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index be5b1f6740..8eebb60a2e 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,8 @@ 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 +3074,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 +3089,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 +3098,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 +3134,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 +3220,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 +3254,8 @@ 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