From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6wT-0002yT-L5 for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:53:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW6wN-0005Xu-LQ for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:53:53 -0400 Message-ID: <525D6503.4080507@redhat.com> Date: Tue, 15 Oct 2013 17:53:39 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1381848773-689-1-git-send-email-pbonzini@redhat.com> <1381848773-689-5-git-send-email-pbonzini@redhat.com> <20131015154014.GA8760@redhat.com> In-Reply-To: <20131015154014.GA8760@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" Cc: cornelia.huck@de.ibm.com, qemu-stable@nongnu.org, qemu-devel@nongnu.org, afaerber@suse.de 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? 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