Re: [PATCH v4 2/4] block: add bdrv_co_delete_file_noerr

2020-12-09 Thread Maxim Levitsky
On Wed, 2020-12-09 at 18:34 +0100, Alberto Garcia wrote: > On Wed 09 Dec 2020 05:44:39 PM CET, Maxim Levitsky wrote: > > +void coroutine_fn bdrv_co_delete_file_noerr(BlockDriverState *bs) > > +{ > > +Error *local_err = NULL; > > + > > +if (!bs) { > > +return; > > +} > > + > > +

Re: [PATCH v4 2/4] block: add bdrv_co_delete_file_noerr

2020-12-09 Thread Alberto Garcia
On Wed 09 Dec 2020 05:44:39 PM CET, Maxim Levitsky wrote: > +void coroutine_fn bdrv_co_delete_file_noerr(BlockDriverState *bs) > +{ > +Error *local_err = NULL; > + > +if (!bs) { > +return; > +} > + > +int ret = bdrv_co_delete_file(bs, &local_err); ^^^ According to th

[PATCH v4 2/4] block: add bdrv_co_delete_file_noerr

2020-12-09 Thread Maxim Levitsky
This function wraps bdrv_co_delete_file for the common case of removing a file, which was just created by format driver, on an error condition. It hides the -ENOTSUPP error, and reports all other errors otherwise. Signed-off-by: Maxim Levitsky --- block.c | 23