OSDN Git Service

vvfat: Use opened node as backing file
authorKevin Wolf <kwolf@redhat.com>
Wed, 15 Feb 2017 19:51:58 +0000 (20:51 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 24 Feb 2017 15:09:23 +0000 (16:09 +0100)
commita8a4d15c1c34d3cec704fb64eba4a3745a140a97
tree8f9de5ab3298ea3d437349e76349b8b98a1f6a62
parent680c7f96062e8c9fcc560eaf06fce164e2a564bc
vvfat: Use opened node as backing file

We should not try to assign a not yet opened node as the backing file,
because as soon as the permission system is added it will fail.  The
just added bdrv_new_open_driver() function is the right tool to open a
file with an internal driver, use it.

In case anyone wonders whether that magic fake backing file to trigger a
special action on 'commit' actually works today: No, not for me. One
reason is that we've been adding a raw format driver on top for several
years now and raw doesn't support commit. Other reasons include that the
backing file isn't writable and the driver doesn't support reopen, and
it's also size 0 and the driver doesn't support bdrv_truncate. All of
these are easily fixable, but then 'commit' ended up in an infinite loop
deep in the vvfat code for me, so I thought I'd best leave it alone. I'm
not really sure what it was supposed to do anyway.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block/vvfat.c