OSDN Git Service

block/file-posix: introduce helper functions for sysfs attributes
authorSam Li <faithilikerun@gmail.com>
Mon, 8 May 2023 04:55:27 +0000 (12:55 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 15 May 2023 12:17:03 +0000 (08:17 -0400)
commita735b56e49be6f227f3f33be837a74c069441a48
tree2fced91df1e7013e714ae224c69efd2c7ee32851
parent72ca800ec5eca1a36a741ce3e878cf675672dc9c
block/file-posix: introduce helper functions for sysfs attributes

Use get_sysfs_str_val() to get the string value of device
zoned model. Then get_sysfs_zoned_model() can convert it to
BlockZoneModel type of QEMU.

Use get_sysfs_long_val() to get the long value of zoned device
information.

Signed-off-by: Sam Li <faithilikerun@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20230508045533.175575-3-faithilikerun@gmail.com
Message-id: 20230324090605.28361-3-faithilikerun@gmail.com
[Adjust commit message prefix as suggested by Philippe Mathieu-Daudé
<philmd@linaro.org>.
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/file-posix.c
include/block/block_int-common.h