From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRNxg-00049J-Er for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRNxY-0002h3-Kk for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:59:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRNxY-0002gv-Ca for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:58:56 -0400 Message-ID: <50894598.8030401@redhat.com> Date: Thu, 25 Oct 2012 15:58:48 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <93cf825d-ecca-4367-8b74-4a69c53b5801@mailpro> <5088EE6A.6050102@redhat.com> <5088EFAF.9000004@redhat.com> <5088F212.5050101@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] qemu-img convert with block driver without .bdrv_create (like iscsi) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ronnie sahlberg Cc: Kevin Wolf , qemu-devel , Alexandre DERUMIER Il 25/10/2012 15:41, ronnie sahlberg ha scritto: > On Thu, Oct 25, 2012 at 1:02 AM, Kevin Wolf wrote: >> Am 25.10.2012 09:52, schrieb Paolo Bonzini: >>> Il 25/10/2012 09:46, Kevin Wolf ha scritto: >>>>>> 1)add a .bdrv_create in block/iscsi.c ? >>>>>> >>>>>> (like host_device block driver, only open/close the device and check if size if big enough) >>>> Yes, this is the right way. >>> >>> Could it be a default implementation of .bdrv_create (i.e. something >>> you'd do in bdrv_create if the protocol doesn't have it)? >> >> No, there are block drivers that really can't create images. They should >> keep failing. > > Technically, you can not create new LUNs via the iscsi protocol > itself, you can only access pre-existing luns > that have been created by some out-of-band method. > > So basically, with iscsi you can only ever access already preexisting luns. > > In that case I think requiring a .bdrv_create feels wrong. We are not > creating a new LUN here but just opening an already existing LUN. The problem is that bdrv_create is overloaded to mean both "create the backing storage" and "format the image". Only the latter applies to iSCSI and, in general, as far as protocols are concerned bdrv_create is usually a no-op. However, Kevin said he prefers to have an explicit override of bdrv_create for iSCSI. Can you implement that? (I'll then do the same for NBD). Paolo > > What about changing bdrv_create() so that IF there is no .bdrv_create > method, then assume it might be a pre-existing file in which case we > fallback to use .bdrv_open instead. > > regards > ronnie sahlberg >