Re: [PATCH 1/2] KVM: kvm-io: support cookies

Paolo Bonzini
2013-07-03T09:21:32Z

Il 03/07/2013 11:05, Paolo Bonzini ha scritto:
> Nice idea, though I don't really like the duplication between
> kvm_io_bus_write and kvm_io_bus_write_cookie.
>
> Can you make kvm_io_bus_write, and perhaps kvm_io_bus_read too, return
> the cookie, and return -EINVAL here if the cookie is garbage?

On second though---no need to return -EINVAL, you can just pass the
cookie by value and tail-call kvm_io_bus_write. Whatever makes the s390
code look nicer.

Paolo

> (Unfortunately, most callers of kvm_io_bus_read/write expect them to
> never return a value that is >= 0, but there aren't many so it's easily
> solved).