aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/virtio/virtio-rng.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index ff589172bd..03fd04a1e5 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -142,16 +142,15 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp)
Error *local_err = NULL;
if (!vrng->conf.period_ms > 0) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "period",
- "a positive number");
+ error_setg(errp, "'period' parameter expects a positive integer");
return;
}
/* Workaround: Property parsing does not enforce unsigned integers,
* So this is a hack to reject such numbers. */
if (vrng->conf.max_bytes > INT64_MAX) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "max-bytes",
- "a non-negative integer below 2^63");
+ error_setg(errp, "'max-bytes' parameter must be non-negative, "
+ "and less than 2^63");
return;
}
@@ -181,7 +180,7 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp)
vrng->rng = vrng->conf.rng;
if (vrng->rng == NULL) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "rng", "a valid object");
+ error_setg(errp, "'rng' parameter expects a valid object");
return;
}