qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 2/5] qdev-properties: Add DEFINE_PROP_ON_OFF_AUTO_BIT64()


From: Akihiko Odaki
Subject: Re: [PATCH v3 2/5] qdev-properties: Add DEFINE_PROP_ON_OFF_AUTO_BIT64()
Date: Tue, 16 Jul 2024 15:23:56 +0900
User-agent: Mozilla Thunderbird

On 2024/07/15 20:47, Daniel P. Berrangé wrote:
On Sun, Jul 14, 2024 at 02:11:02PM +0900, Akihiko Odaki wrote:
DEFINE_PROP_ON_OFF_AUTO_BIT64() corresponds to DEFINE_PROP_ON_OFF_AUTO()
as DEFINE_PROP_BIT64() corresponds to DEFINE_PROP_BOOL(). The difference
is that DEFINE_PROP_ON_OFF_AUTO_BIT64() exposes OnOffAuto instead of
bool.

IMHO this shouldn't be implemented in terms of On/Off auto,
as it is misleadingly accepting much more than PROP_ON_OFF
accepts. Rather it should be just DEFINE_PROP_AUTO_BIT64,
implemented in terms of 'bool', with an extra 'auto' value.

I defined it in a way consistent with DEFINE_PROP_ON_OFF_AUTO(). A union of 'bool' and 'auto' would have a behavior somewhat inconsistent with DEFINE_PROP_ON_OFF_AUTO().

Regards,
Akihiko Odaki



reply via email to

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