OSDN Git Service

qdev-properties: add size32 property type
authorRoman Kagan <rvkagan@yandex-team.ru>
Thu, 28 May 2020 22:55:12 +0000 (01:55 +0300)
committerKevin Wolf <kwolf@redhat.com>
Wed, 17 Jun 2020 12:53:40 +0000 (14:53 +0200)
commit914e74cda9a54ac860000aa18882dc40d3c8180b
treea2ce84d8ab678410471b9d788b1048082cbde857
parenta345c5523607a0a4549990cce1be096b63df9668
qdev-properties: add size32 property type

Introduce size32 property type which handles size suffixes (k, m, g)
just like size property, but is uint32_t rather than uint64_t.  It's
going to be useful for properties that are byte sizes but are inherently
32bit, like BlkConf.opt_io_size or .discard_granularity (they are
switched to this new property type in a followup commit).

The getter for size32 is left out for a separate patch as its benefit is
less obvious, and it affects test output; for now the regular uint32
getter is used.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20200528225516.1676602-5-rvkagan@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/core/qdev-properties.c
include/hw/qdev-properties.h