From owner-freebsd-emulation@FreeBSD.ORG Tue Sep 30 22:25:36 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23D4B1065688 for ; Tue, 30 Sep 2008 22:25:36 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7038FC27 for ; Tue, 30 Sep 2008 22:25:35 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by gwyn.kn-bremen.de (Postfix, from userid 10) id 86F29191A29; Wed, 1 Oct 2008 00:25:33 +0200 (CEST) Received: from saturn.kn-bremen.de (noident@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id m8UMHMrJ045154; Wed, 1 Oct 2008 00:17:22 +0200 (CEST) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id m8UMHLZ8045153; Wed, 1 Oct 2008 00:17:21 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Wed, 1 Oct 2008 00:17:20 +0200 To: Anthony Liguori Message-ID: <20080930221720.GA44500@saturn.kn-bremen.de> Mail-Followup-To: Anthony Liguori , qemu-devel@nongnu.org, freebsd-emulation@freebsd.org References: <20080921204025.GA81055@saturn.kn-bremen.de> <200809242210.m8OMAcSZ021572@saturn.kn-bremen.de> <48DCF9FC.2070708@codemonkey.ws> <20080926220445.GA13099@saturn.kn-bremen.de> <200809272252.m8RMq4fu057049@saturn.kn-bremen.de> <48E23CF5.4000805@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48E23CF5.4000805@codemonkey.ws> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-emulation@freebsd.org, qemu-devel@nongnu.org Subject: Re: [Qemu-devel] Re: qemu svn r5281 on FreeBSD - slow usb, vmwarevga, screen updates... (now updated to r5313) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2008 22:25:36 -0000 On Tue, Sep 30, 2008 at 09:51:33AM -0500, Anthony Liguori wrote: > Juergen Lock wrote: >> In article <48DE5256.5000101@codemonkey.ws> you write: >> >>> [...] >>> >> >> >>>>> The one thing that really tripped me up with the whole aio kld-module >>>>> thing. Perhaps we should detect the presence of the module at run time >>>>> and disable aio? I assume kldload can only be run as root? >>>>> >>>> Yes. Atm the ports print a warning when aio is not loaded: >>>> >>> Yeah, I don't think this is enough. I'd rather see AIO be disabled when >>> modfind("aio") is not available (printing a warning along with that would >>> be fine). A non-privileged user cannot load the aio module so it's not >>> very useful to tell them to load it. >>> >> >> OK so how about the following? (only tested with a raw image, but if >> the way its disabled for OpenBSD works for all of them this should as well.) >> >> Oh and am I right qemu-img doesn't use aio? If it actually does we may >> want to add the same check there instead of just disabling it. (I kept it >> enabled for qemu-nbd since thats not built on FreeBSD anyway.) >> > > Disabling aio for everyone is not the right thing if posix-aio is broken. > Well, I went after what is done for the OpenBSD case (CONFIG_AIO not set), i.e. tell bdrv_register() to set bdrv_aio_read & frieds to bdrv_aio_read_em etc for bdrv_raw if aio is not loaded. I found one bug tho, the same should be done for bdrv_host_device, i.e. in block.c bdrv_register(&bdrv_host_device, 0); should be bdrv_register(&bdrv_host_device, emulate_aio); too. The 0 for the others there mean don't emulate i.e. keep aio enabled... Or are you talking about qemu-img? If that would in fact benefit from using aio like this too we could just add the same test as in vl.c. (Or we could move the test to bdrv_init(), I just didn't want to print the warning from in there.) > What would be better is in block-raw-posix.c, to have a one type check of > modfind() (if we're FreeBSD), and if it fails, set a flag that forces the > aio routines to call bdrv_aio_{read,write}_em. > You mean runtime checks every time a raw aio fn is called (even if just a flag?) That's what I was trying to avoid... :) Regards, Juergen