qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/3] block: introducing 'bdrv_co_delete_file'


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v2 1/3] block: introducing 'bdrv_co_delete_file' interface
Date: Mon, 25 Mar 2019 13:10:46 +0100
User-agent: Mutt/1.11.3 (2019-02-01)

Am 22.03.2019 um 18:52 hat Daniel Henrique Barboza geschrieben:
> Adding to Block Drivers the capability of being able to clean up
> its created files can be useful in certain situations. For the
> LUKS driver, for instance, a failure in one of its authentication
> steps can leave files in the host that weren't there before.
> 
> This patch adds the 'bdrv_co_delete_file' interface to block
> drivers and add it to the LUKS driver. The implementation is provided
> in a new 'bdrv_co_delete_file_generic' function inside block.c. This
> function is made public in case other block drivers wants to
> support this cleanup interface as well.
> 
> Suggested-by: Daniel P. Berrangé <address@hidden>
> Signed-off-by: Daniel Henrique Barboza <address@hidden>

This is still wrong. Consider a LUKS image that is accessed via http://
rather than in a local file.

Instead of the "generic" implementation in block.c (which isn't actually
generic, but very specific to local files), this needs to be the
implementation for the file driver in block/file-posix.c.

The call of bdrv_co_delete_file() must then be in the error path of the
same function that called bdrv_create_file(), such as
block_crypto_co_create_opts_luks() in your specific example.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]