From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW76B-0002fS-Cg for qemu-devel@nongnu.org; Tue, 15 Oct 2013 12:04:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW765-0000Xh-E7 for qemu-devel@nongnu.org; Tue, 15 Oct 2013 12:03:55 -0400 Date: Tue, 15 Oct 2013 19:06:20 +0300 From: "Michael S. Tsirkin" Message-ID: <20131015160620.GA8986@redhat.com> References: <1381848773-689-1-git-send-email-pbonzini@redhat.com> <1381848773-689-5-git-send-email-pbonzini@redhat.com> <20131015154014.GA8760@redhat.com> <525D6503.4080507@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <525D6503.4080507@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 04/12] virtio-pci: remove vdev field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: cornelia.huck@de.ibm.com, qemu-stable@nongnu.org, qemu-devel@nongnu.org, afaerber@suse.de On Tue, Oct 15, 2013 at 05:53:39PM +0200, Paolo Bonzini wrote: > Il 15/10/2013 17:40, Michael S. Tsirkin ha scritto: > > On Tue, Oct 15, 2013 at 04:52:45PM +0200, Paolo Bonzini wrote: > >> > @@ -257,7 +271,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) > >> > static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) > >> > { > >> > VirtIOPCIProxy *proxy = opaque; > >> > - VirtIODevice *vdev = proxy->vdev; > >> > + VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); > >> > hwaddr pa; > >> > > >> > switch (addr) { > > Hmm this is also datapath. > > Can this use direct access too, like MSIX? > > It's not datapath if you're using ioeventfd, is it? Well not everyone uses dataplane/vhost. It's the same for MSIX and eventfd really :) > Anywya, what I did for MSIX is just noticing that a variable was only > used in an "else" branch, and sinking the initialization there. You > cannot do the same here. > > Paolo