From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTb94-0000hj-8V for qemu-devel@nongnu.org; Fri, 28 Mar 2014 14:04:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTb8w-0007ZE-8r for qemu-devel@nongnu.org; Fri, 28 Mar 2014 14:04:46 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:56831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTb8v-0007Yy-WB for qemu-devel@nongnu.org; Fri, 28 Mar 2014 14:04:38 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Mar 2014 18:04:36 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id AAD231B08040 for ; Fri, 28 Mar 2014 18:04:29 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s2SI4N7q3211654 for ; Fri, 28 Mar 2014 18:04:23 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s2SI4WNs014762 for ; Fri, 28 Mar 2014 12:04:35 -0600 Date: Fri, 28 Mar 2014 19:04:28 +0100 From: Greg Kurz Message-ID: <20140328190428.29c8e95f@bahia.local> In-Reply-To: References: <20140328105709.21018.88000.stgit@bahia.local> <20140328105756.21018.57522.stgit@bahia.local> <20140328181326.22c0a6a5@bahia.local> <5335AFA7.9010306@suse.de> <20140328183729.5aeb724e@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 6/8] virtio-scsi: use virtio wrappers to access headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Kevin Wolf , Thomas Huth , "Michael S. Tsirkin" , Marc Zyngier , Rusty Russell , Alexander Graf , QEMU Developers , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini , Anthony Liguori , Andreas =?UTF-8?B?RsOkcmJlcg==?= On Fri, 28 Mar 2014 17:43:07 +0000 Peter Maydell wrote: > On 28 March 2014 17:37, Greg Kurz wrote: > > And while we are at it, since we pass &address_space_memory to all > > occurences of virtio_*_phys() and I don't see why we would change > > that, maybe we can also move that into the helpers. Thoughts ? > > In the longer term I'm hoping that references to > &address_space_memory go away -- we should be modelling > separate address spaces per CPU and per every other > thing that can act as a DMA master (ie issue memory > transactions). I'm not sure exactly how virtio ought to > work since these accesses directly to memory are a total > hack, but probably we will end up setting the virtio > device up and handing it an AddressSpace* that it should use. > Ok, I am now convinced. Let's make struct VirtIODevice* be the first argument for all helpers and kill the AddressSpace* one. Unless you envision we could end up with different address spaces accross multiple virtio devices, I would then do as proposed above... Even if we add an AddressSpace* to devices, the API will remain the same. > thanks > -- PMM > Cheers. -- Gregory Kurz kurzgreg@fr.ibm.com gkurz@linux.vnet.ibm.com Software Engineer @ IBM/Meiosys http://www.ibm.com Tel +33 (0)562 165 496 "Anarchy is about taking complete responsibility for yourself." Alan Moore.