From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJPet-0004Em-7x for qemu-devel@nongnu.org; Wed, 13 Jan 2016 12:56:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJPes-00077t-3q for qemu-devel@nongnu.org; Wed, 13 Jan 2016 12:56:35 -0500 Date: Wed, 13 Jan 2016 17:56:24 +0000 From: "Daniel P. Berrange" Message-ID: <20160113175624.GK26697@redhat.com> References: <1452624982-19332-1-git-send-email-berrange@redhat.com> <1452624982-19332-8-git-send-email-berrange@redhat.com> <20160113174441.GC4356@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160113174441.GC4356@noname.redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v1 07/15] block: add flag to indicate that no I/O will be performed Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org On Wed, Jan 13, 2016 at 06:44:41PM +0100, Kevin Wolf wrote: > Am 12.01.2016 um 19:56 hat Daniel P. Berrange geschrieben: > > When opening an image it is useful to know whether the caller > > intends to perform I/O on the image or not. In the case of > > encrypted images this will allow the block driver to avoid > > having to prompt for decryption keys when we merely want to > > query header metadata about the image. eg qemu-img info > > > > Signed-off-by: Daniel P. Berrange > > Would it be worth adding assertions to the block layer I/O functions > (most importantly, bdrv_aligned_preadv/pwritev) that this flag isn't > set? Yes, I think so. In the read/write code paths that trigger encryption, I'm already doing an assert that the encryption context is setup, which is indirectly related to BDRV_O_NO_IO. It is probably worth adding an assertion explicitly based on the flag at the top level though, as it'd give a clearer error if it ever got triggered. 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 :|