[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3] virtio-rng: Add human-readable error message
From: |
Amit Shah |
Subject: |
Re: [Qemu-devel] [PATCH v3] virtio-rng: Add human-readable error message for negative max-bytes parameter |
Date: |
Tue, 22 Jul 2014 21:26:49 +0530 |
On (Tue) 22 Jul 2014 [11:30:28], John Snow wrote:
>
> On 07/22/2014 07:48 AM, Amit Shah wrote:
> >>>>- assert(vrng->conf.max_bytes <= INT64_MAX);
> >>>>+ /* 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");
> >>>Huh, why do we allow 0? There's no reason to have 0 as a max-bytes
> >>>value as well...
> >>Could be treated as separate problem.
> >Yep, don't mean to hold this up for that one.
> >
> >Thanks for the reviewed-by.
>
> Yes, 0 makes no sense, but there are a lot of extremely low values that
> cause problems.
0 makes no sense, but other low values (even 1) is just a very frugal
host admin trying to preserve his entropy pool. But for the guest,
something is better than nothing.
I don't see how such low values would cause problems.
> The current release allows you to input 0 so I left it
> as-is.
Yes, the right thing to do for this patch.
> The decision for what a reasonable minimum might be is perhaps up to
> the user, unless a better technical limit is found (like 1K? 2K? 4K?)
That's policy, and we should leave that to the admins.
Amit