OSDN Git Service

block: Remove second bdrv_open() recursion
authorKevin Wolf <kwolf@redhat.com>
Wed, 4 Jun 2014 12:19:44 +0000 (14:19 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 26 Jun 2014 11:51:01 +0000 (13:51 +0200)
commit76c591b013782217cad67b35c74cd249e0413439
tree3170d71b2ce748d134bdb693990996cbc1c4cdc5
parentb348f3311c1c54ab4abfd7958176ce5ec6407543
block: Remove second bdrv_open() recursion

This recursion was introduced in commit 505d7583 in order to allow
nesting image formats. It only ever takes effect when the user
explicitly specifies a driver name and that driver isn't suitable for
the protocol level.

We can check this earlier in bdrv_open() and if the explicitly
requested driver is a format driver, clear BDRV_O_PROTOCOL so that
another bs->file layer is opened.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
block.c