• Subject: [Qemu-devel] [PATCH] xics_kvm: fix a build break
  • Author: Cédric Le Goater
  • Date: June 12, 2018, 10:08 a.m.
  • Patches: 1 / 1
Changeset
hw/intc/xics_kvm.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
Git apply log
Switched to a new branch '20180612100857.23093-1-clg@kaod.org'
Applying: xics_kvm: fix a build break
fatal: sha1 information is lacking or useless (hw/intc/xics_kvm.c).
error: could not build fake ancestor
Patch failed at 0001 xics_kvm: fix a build break
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Failed to apply patch:
[Qemu-devel] [PATCH] xics_kvm: fix a build break
[Qemu-devel] [PATCH] xics_kvm: fix a build break
Posted by Cédric Le Goater, 1 week ago
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>
---

 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..2113b6987a45 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(err);
             return ret;
         }
     }
-- 
2.13.6


Re: [Qemu-devel] [PATCH] xics_kvm: fix a build break
Posted by Cédric Le Goater, 1 week ago
Forget that patch its bogus. sending a v2.

On 06/12/2018 12:08 PM, 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>
> ---
> 
>  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..2113b6987a45 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(err);
>              return ret;
>          }
>      }
>