On Wed, Dec 15, 2021 at 02:41:32PM +0100, Markus Armbruster wrote: > Peter Xu <pet...@redhat.com> writes: > > > On Wed, Dec 15, 2021 at 03:56:55PM +0800, Hyman Huang wrote: > >> > > +{ 'command': 'vcpu-dirty-limit', > >> > > + 'data': { 'enable': 'bool', > >> > > + '*cpu-index': 'uint64', > >> > > + '*dirty-rate': 'uint64'} } > >> > > >> > Drop @enable, please. > >> > > >> > If @dirty-rate is present, set the limit to its value. > >> > > >> > If it's absent, cancel the limit. > >> > > >> Ok. Indeed, this is the simplest style. :) > >> > >> So the final qmp format should be like: > >> > >> case 1: setup vcpu 0 dirty page limit 100MB/s > >> vcpu-dirty-limit cpu-index=0 dirty-rate=100MB/s > >> > >> case 2: cancle vcpu 0 dirty page limit > >> vcpu-dirty-limit cpu-index=0 > > > > I actually agree with what you said... for human beings no one will read it > > as > > "disable vcpu throttling", instead people could consider it enables vcpu > > throttle with a default dirty rate from a gut feeling. > > > > I think what Markus suggested is the simplest solution for computers, but it > > can confuse human beings. So it turns out to be a general question to QMP > > scheme design: should we always assume QMP client to be a piece of > > software, or > > should we still consider the feeling of human beings operating on QMP > > interfaces using qmp-shell. > > > > IMHO we should still consider the latter, if we don't lose much, anyway. > > But I > > don't have a strong opinion. > > If you want a more explicit interface, then I'd recommend to go right > back to v7: > > {"execute": "set-vcpu-dirty-limit", > "arguments": {"cpu-index": 0, "dirtyrate": 200}} > > {"execute": "cancel-vcpu-dirty-limit", > "arguments": {"cpu-index": 0}} > > Bonus: it already has my Acked-by.
Fair enough. :) That looks good to me too. Yong, please hold-off a bit on reposting (if there's a plan) - I'll read the other parts soon.. Thanks, -- Peter Xu