From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49590 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pelwq-0007IB-NW for qemu-devel@nongnu.org; Mon, 17 Jan 2011 05:04:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pelwo-0002zv-Rz for qemu-devel@nongnu.org; Mon, 17 Jan 2011 05:04:28 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]:53713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pelwo-0002zp-Jv for qemu-devel@nongnu.org; Mon, 17 Jan 2011 05:04:26 -0500 Received: by wyg36 with SMTP id 36so5305740wyg.4 for ; Mon, 17 Jan 2011 02:04:25 -0800 (PST) Date: Mon, 17 Jan 2011 10:04:05 +0000 From: Stefan Hajnoczi Subject: Re: [Qemu-devel] Re: [PATCH] usb-msd: Add usb-storage, removable=on|off property Message-ID: <20110117100405.GA7123@stefanha-thinkpad.localdomain> References: <1295049643-23443-1-git-send-email-stefanha@linux.vnet.ibm.com> <20110117092126.GB19683@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110117092126.GB19683@lst.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Kevin Wolf , Stefan Hajnoczi , "Justin M. Forbes" , qemu-devel@nongnu.org On Mon, Jan 17, 2011 at 10:21:26AM +0100, Christoph Hellwig wrote: > The actual removable bit looks fine, but I don't think the connection of > the change callback looks sane. What's the rationale for it? Since we're using bdrv_set_removable(), the user may try to eject the block device from the QEMU monitor. At that point we have a closed BlockDriverState and all operations will (at best) error since there is no medium. The callback removes the USB MSD so that eject is equivalent to removing the device. It's a hack and we could remove it, but then we're left with a weird guest-visible state that you can't get into with a physical USB thumbdrive. I was considering not using bdrv_set_removable() and instead adding a hint to the BlockDriverState which gets checked when constructing the SCSI INQUIRY response. If we take that approach, then QEMU doesn't consider the block device removable in the eject/change medium sense. Stefan