correctly configure I/O Scheduler for usage with the YAML file
correctly configure I/O Scheduler for usage with the YAML file

We had recently a bug with the I/O Scheduler where it was not configured
correctly for the case where --max-io-requests (legacy) was passed.

The solution for that involved testing for whether or not we have
specified a capacity for the io_queue: an io_queue with a capacity is a
legacy io_queue, and an io_queue without a capacity is configured with
the new yaml method.

The problem is that despite that being the intention, that was not what
I wrote. Instead of testing for _capacity to be the default, I tested
for cfg.capacity, which is divided by the number of I/O Queues already
As a result, we would now never take the yaml-config branch.

This patch changes that and also proactively works to avoid such problems
in the future by changing the default state to optional, instead of just
std::numeric_limits<unsigned>::max().

Signed-off-by: Glauber Costa <7ba9037b0dd006f9408bd45b94707becd5cd4e87@scylladb.com>
Message-Id: <20180827142820.7856-1-7ba9037b0dd006f9408bd45b94707becd5cd4e87@scylladb.com>

scylladb/seastar,dreamsxin/seastar,dreamsxin/seastar,scylladb/seastar,syuu1228/seastar,syuu1228/seastar,scylladb/seastar,avikivity/seastar,avikivity/seastar,syuu1228/seastar,dreamsxin/seastar,cloudius-systems/seastar,avikivity/seastar,cloudius-systems/seastar,cloudius-systems/seastar