summaryrefslogtreecommitdiffstats
path: root/hw/core/qdev-properties.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/core/qdev-properties.c')
-rw-r--r--hw/core/qdev-properties.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 2e47f70eb4..ba81709142 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -580,7 +580,8 @@ static void set_blocksize(Object *obj, Visitor *v, void *opaque,
error_propagate(errp, local_err);
return;
}
- if (value < min || value > max) {
+ /* value of 0 means "unset" */
+ if (value && (value < min || value > max)) {
error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,
dev->id?:"", name, (int64_t)value, min, max);
return;