From: David Gibson <david@gibson.dropbear.id.au>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Greg Kurz <groug@kaod.org>,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v2] xics_kvm: fix a build break
Date: Wed, 13 Jun 2018 09:43:18 +1000 [thread overview]
Message-ID: <20180612234318.GL30690@umbus.fritz.box> (raw)
In-Reply-To: <20180612101135.23852-1-clg@kaod.org>
[-- Attachment #1: Type: text/plain, Size: 2414 bytes --]
On Tue, Jun 12, 2018 at 12:11:35PM +0200, Cédric Le Goater wrote:
> On CentOS 7.5, gcc-4.8.5-28.el7_5.1.ppc64le fails to build QEMU due to :
>
> hw/intc/xics_kvm.c: In function ‘ics_set_kvm_state’:
> hw/intc/xics_kvm.c:281:13: error: ‘ret’ may be used uninitialized in this
> function [-Werror=maybe-uninitialized]
> return ret;
>
> Fix the breakage and also remove the extra error reporting as
> kvm_device_access() already provides a substantial error message.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Applied to ppc-for-3.0, thanks.
> ---
>
> Greg, can you please test ? RHEL7.5 does not catch the issue with the
> same compiler level :/ I don't understand why.
>
> hw/intc/xics_kvm.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
> index 8bdf6afe82a0..8dba2f84e71e 100644
> --- a/hw/intc/xics_kvm.c
> +++ b/hw/intc/xics_kvm.c
> @@ -186,8 +186,7 @@ static void ics_get_kvm_state(ICSState *ics)
> kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES,
> i + ics->offset, &state, false, &local_err);
> if (local_err) {
> - error_report("Unable to retrieve KVM interrupt controller state"
> - " for IRQ %d: %s", i + ics->offset, strerror(errno));
> + error_report_err(local_err);
> exit(1);
> }
>
> @@ -273,11 +272,10 @@ static int ics_set_kvm_state(ICSState *ics, int version_id)
> state |= KVM_XICS_QUEUED;
> }
>
> - kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES,
> - i + ics->offset, &state, true, &local_err);
> + ret = kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES,
> + i + ics->offset, &state, true, &local_err);
> if (local_err) {
> - error_report("Unable to restore KVM interrupt controller state"
> - " for IRQs %d: %s", i + ics->offset, strerror(errno));
> + error_report_err(local_err);
> return ret;
> }
> }
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-06-12 23:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 10:11 [Qemu-devel] [PATCH v2] xics_kvm: fix a build break Cédric Le Goater
2018-06-12 11:41 ` Greg Kurz
2018-06-12 12:19 ` Cédric Le Goater
2018-06-12 23:43 ` David Gibson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180612234318.GL30690@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).