From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:49781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMD4w-0005kY-Ps for qemu-devel@nongnu.org; Thu, 02 May 2019 10:52:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMD4v-0003BC-Np for qemu-devel@nongnu.org; Thu, 02 May 2019 10:52:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3202) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMD4v-0003AD-IX for qemu-devel@nongnu.org; Thu, 02 May 2019 10:52:53 -0400 From: Igor Mammedov Date: Thu, 2 May 2019 16:52:03 +0200 Message-Id: <1556808723-226478-16-git-send-email-imammedo@redhat.com> In-Reply-To: <1556808723-226478-1-git-send-email-imammedo@redhat.com> References: <1556808723-226478-1-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v4 15/15] tests: acpi: print error unable to dump ACPI table during rebuild List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laszlo Ersek , "Michael S. Tsirkin" , Gonglei , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Shannon Zhao , Wei Yang , Andrew Jones , Shameer Kolothum , Ben Warren , xuwei5@hisilicon.com, xuwei5@huawei.com, linuxarm@huawei.com Instead of just asserting print the error that lead to assert first. While at it move assert into rebuild branch, which removes redundant check done in case of !rebuild branch is taken (the later is taken care of by g_assert_no_error). Signed-off-by: Igor Mammedov Reviewed-by: Wei Yang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v4: * fix typo in commit message (Reviewed-by: Philippe Mathieu-Daud=C3=A9 = ) --- tests/bios-tables-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index eaa1b0c..6cb8b16 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -195,11 +195,14 @@ static void dump_aml_files(test_data *data, bool re= build) sdt->aml, ext); fd =3D g_open(aml_file, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH); + if (fd < 0) { + perror(aml_file); + } + g_assert(fd >=3D 0); } else { fd =3D g_file_open_tmp("aml-XXXXXX", &sdt->aml_file, &error)= ; g_assert_no_error(error); } - g_assert(fd >=3D 0); =20 ret =3D qemu_write_full(fd, sdt->aml, sdt->aml_len); g_assert(ret =3D=3D sdt->aml_len); --=20 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1C4FC04AA9 for ; Thu, 2 May 2019 15:18:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9489620675 for ; Thu, 2 May 2019 15:18:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9489620675 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:52953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMDTF-0001vO-Rw for qemu-devel@archiver.kernel.org; Thu, 02 May 2019 11:18:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMD4w-0005kY-Ps for qemu-devel@nongnu.org; Thu, 02 May 2019 10:52:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMD4v-0003BC-Np for qemu-devel@nongnu.org; Thu, 02 May 2019 10:52:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3202) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMD4v-0003AD-IX for qemu-devel@nongnu.org; Thu, 02 May 2019 10:52:53 -0400 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 B363A330260; Thu, 2 May 2019 14:52:52 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE10D71C80; Thu, 2 May 2019 14:52:48 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Thu, 2 May 2019 16:52:03 +0200 Message-Id: <1556808723-226478-16-git-send-email-imammedo@redhat.com> In-Reply-To: <1556808723-226478-1-git-send-email-imammedo@redhat.com> References: <1556808723-226478-1-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" 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.29]); Thu, 02 May 2019 14:52:52 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 15/15] tests: acpi: print error unable to dump ACPI table during rebuild X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jones , Ben Warren , "Michael S. Tsirkin" , Laszlo Ersek , linuxarm@huawei.com, Shameer Kolothum , Shannon Zhao , Gonglei , Wei Yang , xuwei5@huawei.com, xuwei5@hisilicon.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Message-ID: <20190502145203.TzLilQB_P7JOwwzMDyfLQ3V3b3IzhaPm-ccLbgxlFMM@z> Instead of just asserting print the error that lead to assert first. While at it move assert into rebuild branch, which removes redundant check done in case of !rebuild branch is taken (the later is taken care of by g_assert_no_error). Signed-off-by: Igor Mammedov Reviewed-by: Wei Yang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v4: * fix typo in commit message (Reviewed-by: Philippe Mathieu-Daud=C3=A9 = ) --- tests/bios-tables-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index eaa1b0c..6cb8b16 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -195,11 +195,14 @@ static void dump_aml_files(test_data *data, bool re= build) sdt->aml, ext); fd =3D g_open(aml_file, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH); + if (fd < 0) { + perror(aml_file); + } + g_assert(fd >=3D 0); } else { fd =3D g_file_open_tmp("aml-XXXXXX", &sdt->aml_file, &error)= ; g_assert_no_error(error); } - g_assert(fd >=3D 0); =20 ret =3D qemu_write_full(fd, sdt->aml, sdt->aml_len); g_assert(ret =3D=3D sdt->aml_len); --=20 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5C3BC04AAF for ; Thu, 16 May 2019 12:45:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC15C20815 for ; Thu, 16 May 2019 12:45:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC15C20815 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:54313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRFli-00063N-Vg for qemu-devel@archiver.kernel.org; Thu, 16 May 2019 08:45:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRFO0-0002Eb-Cc for qemu-devel@nongnu.org; Thu, 16 May 2019 08:21:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRFNw-0003EC-NY for qemu-devel@nongnu.org; Thu, 16 May 2019 08:21:24 -0400 Received: from mail-qk1-f171.google.com ([209.85.222.171]:43681) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRFNw-0003Cz-EE for qemu-devel@nongnu.org; Thu, 16 May 2019 08:21:20 -0400 Received: by mail-qk1-f171.google.com with SMTP id z6so2058350qkl.10 for ; Thu, 16 May 2019 05:21:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=/L0JLOdIaBhKUSCjEGKCuHpfFulwdCMtoNoYZbrd6mk=; b=ZXP+9bYqrcgGjNrkRKGfatK3cJWI93FX2PoKobt11isAZrQqKbJpTIWj5B2mDIJNt/ pmv86FyCqBxYr1/NBYp4pPwSouO67U5zmFPOqCXdl4K9mvQNwXwAw3iM4AGw4DkgbPvk JhPlMWRhQQM8hkMxXqSgzbCx1r5Ez8waMHj5tau4/XV42OhBkMhS7ViDobXY3+I0Ouo2 W4eOvSG+LSAztgudKwn2Ih1qZUMwjSqmOd6RFmlYsGRj29T9SZfEjhSCWTRuZUGYp5+w PYuRZXNzMYLo1cLakDKc+pfvHkC/5fez+Aj01ETbOin6snBV81/jV//3SXKrdwihBVGT 6QtA== X-Gm-Message-State: APjAAAWVU5TQnvBefLYbvjrhXEcHCb/0KRZeW38zRwHqGBAKL+kUFjgd Ow6o/+wwETKDlIEa5qRDwy8n3Po2y5g= X-Google-Smtp-Source: APXvYqxjpD+Zzsl/o3hQyidOkqDu0wszKEBJd0RDA7TNbrLOofHiWMjYo1hsChhO9jH05FSFNXQ9HQ== X-Received: by 2002:a37:8241:: with SMTP id e62mr37211935qkd.355.1558009278475; Thu, 16 May 2019 05:21:18 -0700 (PDT) Received: from redhat.com ([185.54.206.10]) by smtp.gmail.com with ESMTPSA id e3sm3366811qkn.93.2019.05.16.05.21.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 16 May 2019 05:21:17 -0700 (PDT) Date: Thu, 16 May 2019 08:21:15 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1556808723-226478-16-git-send-email-imammedo@redhat.com> References: <20190515121146.7248-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190515121146.7248-1-mst@redhat.com> X-Mailer: git-send-email 2.17.1.1206.gb667731e2e.dirty X-Mutt-Fcc: =sent X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.222.171 Subject: [Qemu-devel] [PULL 37/37] tests: acpi: print error unable to dump ACPI table during rebuild X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Peter Maydell , Thomas Huth , Wei Yang , Paolo Bonzini , Igor Mammedov , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Message-ID: <20190516122115.f-oTBwJ1NBvWTFZVaDteTEK_Y6CTEXDAoQw6HLnngAc@z> From: Igor Mammedov Instead of just asserting print the error that lead to assert first. While at it move assert into rebuild branch, which removes redundant check done in case of !rebuild branch is taken (the later is taken care of by g_assert_no_error). Signed-off-by: Igor Mammedov Reviewed-by: Wei Yang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <1556808723-226478-16-git-send-email-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/bios-tables-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index eaa1b0cf62..6cb8b16488 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -195,11 +195,14 @@ static void dump_aml_files(test_data *data, bool rebuild) sdt->aml, ext); fd = g_open(aml_file, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH); + if (fd < 0) { + perror(aml_file); + } + g_assert(fd >= 0); } else { fd = g_file_open_tmp("aml-XXXXXX", &sdt->aml_file, &error); g_assert_no_error(error); } - g_assert(fd >= 0); ret = qemu_write_full(fd, sdt->aml, sdt->aml_len); g_assert(ret == sdt->aml_len); -- MST From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F9A4C04AAC for ; Mon, 20 May 2019 23:32:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0544120863 for ; Mon, 20 May 2019 23:32:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0544120863 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:43642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSrm4-0000f3-7r for qemu-devel@archiver.kernel.org; Mon, 20 May 2019 19:32:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSrRc-0008Er-Ox for qemu-devel@nongnu.org; Mon, 20 May 2019 19:11:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSrRa-0008Sz-TJ for qemu-devel@nongnu.org; Mon, 20 May 2019 19:11:48 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:46812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSrRa-0008Sm-Oh for qemu-devel@nongnu.org; Mon, 20 May 2019 19:11:46 -0400 Received: by mail-qt1-f181.google.com with SMTP id z19so18284094qtz.13 for ; Mon, 20 May 2019 16:11:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=/L0JLOdIaBhKUSCjEGKCuHpfFulwdCMtoNoYZbrd6mk=; b=bEUycg0sxOKul6sk7MQPML9CeuNxfVtCgv0Tp/pxsivC+SXAV8eRAtIiUSP8VLcL+E aEzkqhtBXJ3EYWDIJgPRYF1WEoDO9RAWASyjyzmfwzGync1trSBL2fiQqB+aAaemv9p+ mlKuDv2gFehDtpJ7xOuc70rzufic6pee5KZCqkcw7gmU5saGk4atRy0gUObLyULurlS5 rR3U6SuFqGNVtqAirsNQ4BQd0Dmlc+GFOZF//kChGXvEh3leoHXZfPfSmLk7OBiY8veF AOuMRuP+D88vpY3v19z/CiM6VVam+DH1KFAn3SM0HoOEtJFHhwX+dsTtZgCNiDgPW4XS 2b5A== X-Gm-Message-State: APjAAAVNH6mQ0OPPNeH34cZblMzcLO+QwM/H8RbJaDlfy119ip7Avtav HybHIZEHhFboWVTQr67iP5YgjwOk6ws= X-Google-Smtp-Source: APXvYqzyy4R+oUQKX2I9Z6MtqjDgVt55rOjChGzPRHZBroO9+VJnNt9/8PAbueyiS3KLQGiiCLUWUg== X-Received: by 2002:a0c:b626:: with SMTP id f38mr7747163qve.223.1558393905975; Mon, 20 May 2019 16:11:45 -0700 (PDT) Received: from redhat.com (pool-173-76-105-71.bstnma.fios.verizon.net. [173.76.105.71]) by smtp.gmail.com with ESMTPSA id t3sm6648981qto.36.2019.05.20.16.11.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 20 May 2019 16:11:45 -0700 (PDT) Date: Mon, 20 May 2019 19:11:44 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1556808723-226478-16-git-send-email-imammedo@redhat.com> References: <20190520231008.20140-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190520231008.20140-1-mst@redhat.com> X-Mailer: git-send-email 2.17.1.1206.gb667731e2e.dirty X-Mutt-Fcc: =sent X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.160.181 Subject: [Qemu-devel] [PULL v2 36/36] tests: acpi: print error unable to dump ACPI table during rebuild X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Peter Maydell , Thomas Huth , Wei Yang , Paolo Bonzini , Igor Mammedov , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Message-ID: <20190520231144.6tSc5A4PskY8YLNILCOVCz5wqOYwZRTmnYqKpJcp-xA@z> From: Igor Mammedov Instead of just asserting print the error that lead to assert first. While at it move assert into rebuild branch, which removes redundant check done in case of !rebuild branch is taken (the later is taken care of by g_assert_no_error). Signed-off-by: Igor Mammedov Reviewed-by: Wei Yang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <1556808723-226478-16-git-send-email-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/bios-tables-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index eaa1b0cf62..6cb8b16488 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -195,11 +195,14 @@ static void dump_aml_files(test_data *data, bool rebuild) sdt->aml, ext); fd = g_open(aml_file, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH); + if (fd < 0) { + perror(aml_file); + } + g_assert(fd >= 0); } else { fd = g_file_open_tmp("aml-XXXXXX", &sdt->aml_file, &error); g_assert_no_error(error); } - g_assert(fd >= 0); ret = qemu_write_full(fd, sdt->aml, sdt->aml_len); g_assert(ret == sdt->aml_len); -- MST