From patchwork Thu May 19 19:27:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 68201 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3379763qge; Thu, 19 May 2016 12:29:41 -0700 (PDT) X-Received: by 10.140.29.162 with SMTP id b31mr646737qgb.2.1463686181418; Thu, 19 May 2016 12:29:41 -0700 (PDT) Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com. [209.132.183.24]) by mx.google.com with ESMTPS id c135si14069590qhc.46.2016.05.19.12.29.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 19 May 2016 12:29:41 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u4JJRBwm030547; Thu, 19 May 2016 15:27:11 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u4JJRAlj020939 for ; Thu, 19 May 2016 15:27:10 -0400 Received: from colepc.redhat.com (ovpn-116-14.phx2.redhat.com [10.3.116.14]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4JJR997018414; Thu, 19 May 2016 15:27:09 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 19 May 2016 15:27:08 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: nodeinfotest: Remove virSaveLastError() usage 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com It's overkill here, we can use virGetLast* instead --- tests/nodeinfotest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index d8eace5..03500fb 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -44,10 +44,8 @@ linuxTestCompareFiles(char *sysfs_prefix, memset(&nodeinfo, 0, sizeof(nodeinfo)); if (linuxNodeInfoCPUPopulate(sysfs_prefix, cpuinfo, arch, &nodeinfo) < 0) { if (virTestGetDebug()) { - virErrorPtr error = virSaveLastError(); - if (error && error->code != VIR_ERR_OK) - VIR_TEST_DEBUG("\n%s\n", error->message); - virFreeError(error); + if (virGetLastError()) + VIR_TEST_DEBUG("\n%s\n", virGetLastErrorMessage()); } VIR_FORCE_FCLOSE(cpuinfo); goto fail;