From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqgAs-0001EH-L4 for qemu-devel@nongnu.org; Tue, 09 Aug 2011 02:52:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqgAr-0004oc-Q9 for qemu-devel@nongnu.org; Tue, 09 Aug 2011 02:52:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqgAr-0004oV-Il for qemu-devel@nongnu.org; Tue, 09 Aug 2011 02:52:25 -0400 Message-ID: <4E40D921.9080700@redhat.com> Date: Tue, 09 Aug 2011 09:52:17 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1312808972-1718-1-git-send-email-avi@redhat.com> <1312808972-1718-27-git-send-email-avi@redhat.com> <4E40D9F3.5080309@mc.net> In-Reply-To: <4E40D9F3.5080309@mc.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 26/39] pcnet: convert to memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bob Breuer Cc: Blue Swirl , "Michael S. Tsirkin" , qemu-devel@nongnu.org, kvm@vger.kernel.org On 08/09/2011 09:55 AM, Bob Breuer wrote: > > static void lance_cleanup(VLANClientState *nc) > > @@ -117,13 +116,11 @@ static int lance_init(SysBusDevice *dev) > > SysBusPCNetState *d = FROM_SYSBUS(SysBusPCNetState, dev); > > PCNetState *s =&d->state; > > > > - s->mmio_index = > > - cpu_register_io_memory(lance_mem_read, lance_mem_write, d, > > - DEVICE_NATIVE_ENDIAN); > > + memory_region_init_io(&s->mmio,&lance_mem_ops, s, "lance-mmio", 4); > > You've switched up d and s here, so anything that tries to talk to the > ethernet, such as a sparc32 guest, will now cause Qemu to segfault. > > Good catch; will post a fix. Maybe keeping the opaque wasn't such a good idea. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.