From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 1/2] KVM: kvm-io: support cookies Date: Wed, 03 Jul 2013 11:21:23 +0200 Message-ID: <51D3ED13.2020408@redhat.com> References: <1372841780-29645-1-git-send-email-cornelia.huck@de.ibm.com> <1372841780-29645-2-git-send-email-cornelia.huck@de.ibm.com> <51D3E96E.5080405@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Cornelia Huck , Gleb Natapov , Christian Borntraeger , Heiko Carstens , Martin Schwidefsky , KVM , linux-s390 To: unlisted-recipients:; (no To-header on input) Return-path: Received: from mail-qc0-f173.google.com ([209.85.216.173]:44499 "EHLO mail-qc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754628Ab3GCJVc (ORCPT ); Wed, 3 Jul 2013 05:21:32 -0400 In-Reply-To: <51D3E96E.5080405@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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).