qemu-img: Eliminate bdrv_new_open() code duplication
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tue, 13 Apr 2010 09:29:34 +0000 (10:29 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Apr 2010 14:21:57 +0000 (16:21 +0200)
commitc4b32a965b884044d9378deb53a3cb38a639d6eb
tree3fa014e316171345167e1845bd2c861b8742959f
parent7391d75e35e770a48bd2abf5622ed172a4613d69
qemu-img: Eliminate bdrv_new_open() code duplication

Several commands have code to create a BlockDriverState and open a file.
The bdrv_new_open() function can be used to perform these steps.  This
patch converts the qemu-img commands to actually use bdrv_new_open().

Replaced the bdrv_new_open() 'readonly' argument with bdrv_open()-style
flags to support generic flags like BDRV_O_NO_BACKING.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c