Am 07.09.2015 um 14:08 hat Kevin Wolf geschrieben: > Am 04.09.2015 um 21:52 hat Max Reitz geschrieben: > > On 04.09.2015 19:18, Kevin Wolf wrote: > > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > > > --- > > > tests/qemu-iotests/137 | 143 > > > +++++++++++++++++++++++++++++++++++++++++++++ > > > tests/qemu-iotests/137.out | 43 ++++++++++++++ > > > tests/qemu-iotests/group | 1 + > > > 3 files changed, 187 insertions(+) > > > create mode 100755 tests/qemu-iotests/137 > > > create mode 100644 tests/qemu-iotests/137.out > > > > > > diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137 > > > new file mode 100755 > > > index 0000000..ad52f71 > > > --- /dev/null > > > +++ b/tests/qemu-iotests/137 > > > > > > [snip] > > > > > +echo > > > +echo === Try setting some invalid values === > > > +echo > > > + > > > +$QEMU_IO \ > > > + -c "reopen -o lazy-refcounts=42" \ > > > + -c "reopen -o > > > cache-size=1M,l2-cache-size=64k,refcount-cache-size=64k" \ > > > + -c "reopen -o cache-size=1M,l2-cache-size=2M" \ > > > + -c "reopen -o cache-size=1M,refcount-cache-size=2M" \ > > > + -c "reopen -o l2-cache-size=256T" \ > > > + -c "reopen -o l2-cache-size=64G" \ > > > > Testing this seems risky. The rest looks fine, but I'm not sure whether > > this is really needed so much that we should risk the test failing on > > some machines, especially in the future. > > I think we should be testing the "too large, but not much too large" > case. A risk of false positives is better than a risk to break things > without noticing. I could make it something like 64T, though, that > should last a bit longer. The "much too large" case starts at 128T > (INT_MAX * s->cluster_size == 2G * 64k).
...except that qcow2_cache_create() also allocates a Qcow2CachedTable array and that one is small enough in comparison that we'd end up again in the same range as before, where allocations might not fail right away, but fill up the swap. Fair enough, I'll remove the lines. Do you want a v3 on the list or can I fix it while merging? Kevin
pgpZ6tmUt64Rw.pgp
Description: PGP signature