From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0V8E-0006rF-0c for qemu-devel@nongnu.org; Wed, 11 May 2016 10:29:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0V88-00089h-IW for qemu-devel@nongnu.org; Wed, 11 May 2016 10:28:56 -0400 Date: Wed, 11 May 2016 15:28:41 +0100 From: "Daniel P. Berrange" Message-ID: <20160511142840.GJ20333@redhat.com> Reply-To: "Daniel P. Berrange" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Subject: [Qemu-devel] Creating / formatting volumes with non-file based block backends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-block@nongnu.org I'm looking once again at the process of creating volumes for QEMU formatted with LUKS encryption. For plain files it is easily possible with qemu-img create -f luks \ --object secret,id=sec0,file=passphrase.txt \ -o key-secret=sec0 \ demo.luks 10G where 'demo.luks' is the filename to be created, mapping through to the block driver API int (*bdrv_create)(const char *filename, QemuOpts *opts, Error **errp); This creates a plain file and then formats it with LUKS. Now if I want to instead create a non-plain file (eg a glusterfs image) and format it with LUKS, AFAICT, this is not possible since we can't specify options / driver for the next level below the LUKS block backend, we've only got a plain filename. I'm wondering if perhaps using the JSON format for the 'filename' parameter value might work, but it would be desirable to use the regular nested-opts syntax available everywhere else in the block layer. A second problem arises if I have an already existing volume that I wish to merely format with luks. There's no way to skip the create step for the block backend below the LUKS driver, as create + format are combined into the same operation. It feels like there's a potential use case for a separate 'qemu-img format' command which just takes a pre-existing image and just formats a new image layout on top of it ? Essentially I would like to be able to create a LUKS formatted image on top of any QEMU block driver backend that supports the bdrv_create operation. I would also like to be able to format LUKS onto any pre-existing image for which there is a QEMU block driver backend with write support. Any thoughts on this ? If there's clarity around design / requirements, I have potential free time for working on this in the 2.7 cycle. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|