[Top][All Lists]

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

Re: [PATCH v2 2/6] accel: accel_available() function

From: Paolo Bonzini
Subject: Re: [PATCH v2 2/6] accel: accel_available() function
Date: Thu, 26 Nov 2020 15:25:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

On 26/11/20 15:13, Claudio Fontana wrote:
One option I see is simply to document the behavior where
accel_available() is declared in accel.h (ie do not use in fast
path), as well as in accel_find() actually, so that both accel_find()
and accel_available() are avoided in fast path and avoid being called
frequently at runtime.

Another option could be to remove the allocation completely, and use
for example accel_find(ACCEL_CLASS_NAME("tcg")), or another option
again would be to remove the allocation and use either a fixed buffer
+ snprintf, or alloca -like builtin code to use the stack, ...

Not a big deal, but with a general utility and short name like
accel_available(name) it might be tempting to use this more in the

I think it's just that the usecase is not that common. "Is this accelerator compiled in the binary" is not something you need after startup (or if querying the monitor).


reply via email to

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