[Top][All Lists]

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

Re: Artificially target-dependend compiles

From: Paolo Bonzini
Subject: Re: Artificially target-dependend compiles
Date: Fri, 5 Nov 2021 17:15:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

On 11/5/21 14:45, Markus Armbruster wrote:
Moving these definitions to machine-target.json moves the generated C
from qapi/qapi-*-machine.[ch] to qapi/qapi-*-machine-target.[ch], where
CONFIG_ACPI_VMGENID is okay.  It also makes qmp_query_vm_generation_id()
target-dependent: it needs qapi/qapi-commands-machine-target.h.

If I understand correctly, the problem that qapi-commands-machine-target.h is target-dependent, because it uses "#ifdef CONFIG_ACPI_VMGENID" around the prototype?

On one hand, the "#ifdef" is unnecessary: the prototype does not depend on anything target-specific. Removing it will avoid the target-dependence. On the other hand, the "#ifdef" has a defensive purpose, in that an unnecessary definition (such as the one currently in the stub) will fail due to the implicit definition of qmp_query_vm_generation_id().

Have you seen similar artificial target-dependence elsewhere?

I can't think of a specific example, but it does ring some bells.


reply via email to

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