summary refs log tree commit diff stats
path: root/hw/core/qdev-properties.c
diff options
context:
space:
mode:
authorRoman Kagan <rvkagan@yandex-team.ru>2020-05-29 01:55:14 +0300
committerKevin Wolf <kwolf@redhat.com>2020-06-17 14:53:40 +0200
commit4f44bbc5bba0858d34b1aa356397847696276546 (patch)
tree7868dd3a14f9f99742f470263a61d1049d2b00e4 /hw/core/qdev-properties.c
parent645b55d1c2bf35ce6344f1f472fa30e327cafce0 (diff)
downloadfocaccia-qemu-4f44bbc5bba0858d34b1aa356397847696276546.tar.gz
focaccia-qemu-4f44bbc5bba0858d34b1aa356397847696276546.zip
block: make BlockConf size props 32bit and accept size suffixes
Convert all size-related properties in BlockConf to 32bit.  This will
accommodate bigger block sizes (in a followup patch).  This also allows
to make them all accept size suffixes, either via DEFINE_PROP_BLOCKSIZE
or via DEFINE_PROP_SIZE32.

Also, since min_io_size is exposed to the guest by scsi and virtio-blk
devices as an uint16_t in units of logical blocks, introduce an
additional check in blkconf_blocksizes to prevent its silent truncation.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20200528225516.1676602-7-rvkagan@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/core/qdev-properties.c')
-rw-r--r--hw/core/qdev-properties.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index c9af6a1341..bd4abdc1d1 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -782,7 +782,7 @@ static void set_blocksize(Object *obj, Visitor *v, const char *name,
 {
     DeviceState *dev = DEVICE(obj);
     Property *prop = opaque;
-    uint16_t *ptr = qdev_get_prop_ptr(dev, prop);
+    uint32_t *ptr = qdev_get_prop_ptr(dev, prop);
     uint64_t value;
     Error *local_err = NULL;
 
@@ -821,7 +821,7 @@ const PropertyInfo qdev_prop_blocksize = {
     .name  = "size",
     .description = "A power of two between " MIN_BLOCK_SIZE_STR
                    " and " MAX_BLOCK_SIZE_STR,
-    .get   = get_uint16,
+    .get   = get_uint32,
     .set   = set_blocksize,
     .set_default_value = set_default_value_uint,
 };