On Thu, Oct 25, 2012 at 1:02 AM, Kevin Wolf <kw...@redhat.com> 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. 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