Received: from eggs.gnu.org ([208.118.235.92]:52223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPBwY-00016K-BH for qemu-devel@nongnu.org; Fri, 19 Oct 2012 08:44:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPBwX-00085K-3v for qemu-devel@nongnu.org; Fri, 19 Oct 2012 08:44:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPBwW-00085D-S3 for qemu-devel@nongnu.org; Fri, 19 Oct 2012 08:44:49 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9JCimcR028493 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Oct 2012 08:44:48 -0400 From: Markus Armbruster References: <153170376.13357325.1350637125350.JavaMail.root@redhat.com> Date: Fri, 19 Oct 2012 14:44:46 +0200 In-Reply-To: <153170376.13357325.1350637125350.JavaMail.root@redhat.com> (Paolo Bonzini's message of "Fri, 19 Oct 2012 04:58:45 -0400 (EDT)") Message-ID: <87wqym3a2p.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 25/25] hmp: add NBD server commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com Paolo Bonzini writes: >> Why's nbd_server_add not needed in HMP? >> >> Oh, it's because HMP's nbd_server_start auto-adds *all* block >> devices, unlinke QMP's nbd-server-start. >> >> Are you sure that's a good idea? > > Yes. Now that we have QMP we can go back and treat HMP as (mostly) a > debugging interface as it was meant to be. > > You don't need any fine-grained control in that case. From the server's > point of view, serving all devices or just one is exactly the same thing. > If you use NBD for block migration, for example, you can choose _on the > source_ which devices you are migrating, but it doesn't harm if more > devices are exposed on the target. > > The only case where this loses is when you hotplug a device and you want > to start serving it. I think this is a minor loss for HMP, but it is a > show-stopper for QMP which hence has to have nbd-server-add. Apropos hotplug. The only way to unexport a block device is to stop the NBD server outright. Once the device backend has been exported, unplugging the device gets rid of the frontend, but the backend stays until you stop the NBD server, or you kill the backend with the big drive_del hammer. Makes me wonder whether we need QMP command nbd-server-del. Back to HMP. I agree that we can the human monitor is again for human users only, thus we don't have to encumber it with the need of tools. I might also buy your argument that extra exports don't really hurt. But device plug / -unplug is just as relevant there as in QMP. If it's a show-stopper for QMP, then I don't think it can be a "minor loss" for HMP. Additionally, two details I don't like: 1. The HMP command looks just like the QMP command (name & arguments), yet does something else. 2. What if we ever change our minds regarding fine-grained NBD export control in the human monitor? Add a second command to start the server without exporting everything? Add a "don't auto-export" argument to the existing command?