qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/14] hvf: add conditional macros around hvf co


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 03/14] hvf: add conditional macros around hvf code in cpus.c
Date: Tue, 29 Aug 2017 10:19:13 +0100
User-agent: Mutt/1.8.3 (2017-05-23)

On Sun, Aug 27, 2017 at 08:56:43PM -0500, Sergio Andres Gomez Del Real wrote:
> @@ -900,6 +904,11 @@ void cpu_synchronize_all_states(void)
>  
>      CPU_FOREACH(cpu) {
>          cpu_synchronize_state(cpu);
> +#ifdef CONFIG_HVF
> +        if (hvf_enabled()) {
> +            hvf_cpu_synchronize_state(cpu);
> +        }
> +#endif

Searching for CONFIG_KVM and CONFIG_HAX in cpus.c produces no results.
How do they solve the same problem without using #ifdef?  They define
nop stubs in "system/$ACCEL.h" so that cpus.c does not need #ifdefs.

Please follow the same approach for hvf.  Using stubs avoids "bitrot"
because the cpus.c kvm/hax code is always compiled, even when the
feature is disabled.  This way no compiler errors/warnings can hide in
the #ifdef regions that aren't compiled by most people.

Please avoid #ifdef whereever possible.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]