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