Re: [PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-02-08 Thread Emanuele Giuseppe Esposito
On 07/02/2022 17:53, Kevin Wolf wrote: > Am 01.02.2022 um 11:30 hat Paolo Bonzini geschrieben: >> On 2/1/22 10:45, Emanuele Giuseppe Esposito wrote: That said, even if they are a different category, I think it makes sense to leave them in the same header file as I/O functions, because

Re: [PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-02-07 Thread Kevin Wolf
Am 01.02.2022 um 11:30 hat Paolo Bonzini geschrieben: > On 2/1/22 10:45, Emanuele Giuseppe Esposito wrote: > > > That said, even if they are a different category, I think it makes sense > > > to leave them in the same header file as I/O functions, because I/O > > > functions are locked out between

Re: [PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-02-01 Thread Paolo Bonzini
On 2/1/22 10:45, Emanuele Giuseppe Esposito wrote: That said, even if they are a different category, I think it makes sense to leave them in the same header file as I/O functions, because I/O functions are locked out between drained_begin and drained_end. Proposed category description: /* *

Re: [PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-02-01 Thread Emanuele Giuseppe Esposito
On 31/01/2022 16:58, Paolo Bonzini wrote: > On 1/31/22 15:54, Kevin Wolf wrote: >> So I guess the decision depends on what you're going to use the >> categories in the future. I get the feeling that we have one more >> category than this series introduces: >> >> * Global State (must run from

Re: [PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-01-31 Thread Paolo Bonzini
On 1/31/22 15:54, Kevin Wolf wrote: So I guess the decision depends on what you're going to use the categories in the future. I get the feeling that we have one more category than this series introduces: * Global State (must run from the main thread/hold the BQL) * I/O (can be called in any

Re: [PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-01-31 Thread Kevin Wolf
Am 31.01.2022 um 14:40 hat Emanuele Giuseppe Esposito geschrieben: > On 27/01/2022 12:01, Kevin Wolf wrote: > >>> +BlockDriverState *bs_ = (bs); \ > >>> +AIO_WAIT_WHILE(bdrv_get_aio_context(bs_), \ > >>> + cond); }) > >> Hmm...

Re: [PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-01-31 Thread Emanuele Giuseppe Esposito
On 27/01/2022 12:01, Kevin Wolf wrote: >> +/* Common functions that are neither I/O nor Global State */ >> + >> +int bdrv_parse_aio(const char *mode, int *flags); > Makes sense to me to have this here, it is just a helper function that > parses stuff and doesn't touch any state. However, what is

Re: [PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-01-27 Thread Kevin Wolf
Am 21.01.2022 um 18:05 hat Emanuele Giuseppe Esposito geschrieben: > block.h currently contains a mix of functions: > some of them run under the BQL and modify the block layer graph, > others are instead thread-safe and perform I/O in iothreads. > It is not easy to understand which function is

[PATCH v6 02/33] include/block/block: split header into I/O and global state API

2022-01-21 Thread Emanuele Giuseppe Esposito
block.h currently contains a mix of functions: some of them run under the BQL and modify the block layer graph, others are instead thread-safe and perform I/O in iothreads. It is not easy to understand which function is part of which group (I/O vs GS), and this patch aims to clarify it. The "GS"