From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTXgy-0007Xs-0J for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTXgt-0006RV-RH for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:46:43 -0400 Received: from mail-da0-f45.google.com ([209.85.210.45]:38859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTXgt-0006RO-JT for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:46:39 -0400 Received: by mail-da0-f45.google.com with SMTP id n15so604742dad.4 for ; Wed, 31 Oct 2012 05:46:38 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <50911D9E.7090408@redhat.com> Date: Wed, 31 Oct 2012 13:46:22 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1349103144-6827-1-git-send-email-pbonzini@redhat.com> <1349103144-6827-9-git-send-email-pbonzini@redhat.com> <20121031112352.GA12937@lst.de> In-Reply-To: <20121031112352.GA12937@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 8/9] qmp: add NBD server commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Anthony Liguori , qemu-devel@nongnu.org, lcapitulino@redhat.com Il 31/10/2012 12:23, Christoph Hellwig ha scritto: > On Mon, Oct 01, 2012 at 04:52:23PM +0200, Paolo Bonzini wrote: >> Adding an NBD server inside QEMU is trivial, since all the logic is >> in nbd.c and can be shared easily between qemu-nbd and QEMU itself. >> The main difference is that qemu-nbd serves a single unnamed export, >> while QEMU serves named exports. > > I've started playing around with qemu-nbd and have started looking into > named exports, aio, and adding snapshort support. I'm wondering if instead > of adding this I should try to base it on your embedded server. qemu-nbd does support AIO in the latest versions. There's also --cache=MODE and --aio=MODE command-line options. In fact, a large part of the code is shared between qemu-nbd and the embedded server. The only difference is that qemu-nbd uses unnamed exports, while qemu names them. qemu-nbd also has options to show only one partition, which you probably do not need. But if you need a QMP interface, adding it to qemu-nbd would really be a bad idea. :) > That would give me the named exports, aio and monitor/qmp based > snapshot creation. > > The only thing to add would be a qemu mode where it doesn't run an > actual guest. You can use qtest mode to get very close to this (even if you send stop/cont by mistake on the monitor, no code will actually run): qemu-system-x86_64 -chardev file,id=null,path=/dev/null -qtest null -machine accel=qtest -m 1 -nodefaults -nographic but having a separate do-nothing target would probably be nicer... though Anthony may have different opinions. Paolo > Does anyone have opinions on this?