From nobody Wed May 1 11:41:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1488535157723754.5936453068629; Fri, 3 Mar 2017 01:59:17 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v239tkYa023773; Fri, 3 Mar 2017 04:55:47 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v239tkmo020765 for ; Fri, 3 Mar 2017 04:55:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id A81E984CE0; Fri, 3 Mar 2017 09:55:46 +0000 (UTC) Received: from moe.brq.redhat.com (dhcp129-131.brq.redhat.com [10.34.129.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EF972D655 for ; Fri, 3 Mar 2017 09:55:46 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 3 Mar 2017 10:55:41 +0100 Message-Id: X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemuDomainSaveImageUpdateDef: Don't overwrite errors from virDomainDefCheckABIStability 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1379200 When we are restoring a domain from a saved image, or just updating its XML in the saved image - we have to make sure that the ABI guests sees will not change. We have a function for that which reports errors. But for some reason if this function fails, we call it again with slightly different argument. Therefore it might happen that we overwrite the original error and leave user with less helpful one. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 77d81755a..2bef0f200 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6109,7 +6109,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, goto cleanup; =20 if (!virDomainDefCheckABIStability(def, newdef_migr)) { - virResetLastError(); + virErrorPtr err =3D virSaveLastError(); =20 /* Due to a bug in older version of external snapshot creation * code, the XML saved in the save image was not a migratable @@ -6117,8 +6117,12 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, * saved XML type, we need to check the ABI compatibility against * the user provided XML if the check against the migratable XML * fails. Snapshots created prior to v1.1.3 have this issue. */ - if (!virDomainDefCheckABIStability(def, newdef)) + if (!virDomainDefCheckABIStability(def, newdef)) { + virSetError(err); + virFreeError(err); goto cleanup; + } + virFreeError(err); =20 /* use the user provided XML */ ret =3D newdef; --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list