From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48549 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PEP40-0005CK-42 for qemu-devel@nongnu.org; Fri, 05 Nov 2010 12:22:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PEP3t-0005j3-0l for qemu-devel@nongnu.org; Fri, 05 Nov 2010 12:22:51 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:36263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PEP3s-0005hI-TI for qemu-devel@nongnu.org; Fri, 05 Nov 2010 12:22:44 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by e6.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oA5GNGdS015055 for ; Fri, 5 Nov 2010 12:23:16 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oA5GMNoX353798 for ; Fri, 5 Nov 2010 12:22:27 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oA5GMNcc013732 for ; Fri, 5 Nov 2010 12:22:23 -0400 Date: Fri, 5 Nov 2010 11:22:18 -0500 From: Ryan Harper Subject: Re: [Qemu-devel] [PATCH 0/3] v4 Decouple block device removal from device removal Message-ID: <20101105162218.GM22381@us.ibm.com> References: <20101103120443.GD3469@us.ibm.com> <20101103172910.GT3469@us.ibm.com> <20101103180224.GB19117@redhat.com> <20101103205929.GF3469@us.ibm.com> <20101103212640.GB20833@redhat.com> <20101104164551.GB20081@us.ibm.com> <20101105142558.GG22381@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , yamahata@valinux.co.jp, "Michael S. Tsirkin" , qemu-devel@nongnu.org, Anthony Liguori , Ryan Harper , Stefan Hajnoczi * Markus Armbruster [2010-11-05 11:11]: > Ryan Harper writes: > > > * Markus Armbruster [2010-11-05 08:28]: > >> I'd be fine with any of these: > >> > >> 1. A new command "device_disconnet ID" (or similar name) to disconnect > >> device ID from any host parts. Nice touch: you don't have to know > >> about the device's host part(s) to disconnect it. But it might be > >> more work than the other two. > > > > This is sort of what netdev_del() and drive_unplug() are today; we're > > just saying sever the connection of this device id. > > No, I have netdev_del as (3). > > All three options are "sort of" the same, just different commands with > a common purpose. > > > I'd like to rename drive_unplug() to blockdev_del() and call it done. I > > was looking at libvirt and the right call to netdev_del is already > > in-place; I'd just need to re-spin my block patch to call blockdev_del() > > after invoking device_del() to match what is done for net. > > Unless I'm missing something, you can't just rename: your unplug does > not delete the host part. > > >> 2. New commands netdev_disconnect, drive_disconnect (or similar names) > >> to disconnect a host part from a guest device. Like (1), except you > >> have to point to the other end of the connection to cut it. > > > > What's the advantage here? We need an additional piece of info (host > > part) in addition to the device id? > > That's a disadvantage. > > Possible advantage: implementation could be slightly easier than (1), > because you don't have to find the host parts. > > >> 3. A new command "drive_del ID" similar to existing netdev_del. This is > >> (2) fused with delete. Conceptual wart: you can't disconnect and > >> keep the host part around. Moreover, delete is slightly dangerous, > >> because it renders any guest device still using the host part > >> useless. > > > > Hrm, I thought that's what (1) is. > > No. > > With (1), the argument is a *device* ID, and we disconnect *all* host > parts connected to this device (typically just one). > > With (3), the argument is a netdev/drive ID, and disconnect *this* host > part from the peer device. > > > Well, either (1) or (3); I'd like to > > rename drive_unplug() to blockdev_del() since they're similar function > > w.r.t removing access to the host resource. And we can invoke them in > > the same way from libvirt (after doing guest notification, remove > > access). > > I'd call it drive_del for now, to match drive_add. OK, drive_del() and as you mentioned, drive_unplug will take out the block driver, but doesn't remove the dinfo object; that ends up dying when we call the device destructor. I think for symmetry we'll want drive_del to remove the dinfo object as well. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx ryanh@us.ibm.com