Re: [Libguestfs] [PATCH libnbd 3/8] copy: Extract create_command and create_buffer helpers

2022-02-22 Thread Nir Soffer
On Mon, Feb 21, 2022 at 5:03 PM Eric Blake wrote: > > On Sun, Feb 20, 2022 at 02:13:58PM +0200, Nir Soffer wrote: > > Creating a new command requires lot of boilerplate that makes it harder > > to focus on the interesting code. Extract a helpers to create a command, > > and the command slice

Re: [Libguestfs] [PATCH libnbd 3/8] copy: Extract create_command and create_buffer helpers

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 02:13:58PM +0200, Nir Soffer wrote: > Creating a new command requires lot of boilerplate that makes it harder > to focus on the interesting code. Extract a helpers to create a command, > and the command slice buffer. > > create_buffer is called only once, but the compiler

[Libguestfs] [PATCH libnbd 3/8] copy: Extract create_command and create_buffer helpers

2022-02-20 Thread Nir Soffer
Creating a new command requires lot of boilerplate that makes it harder to focus on the interesting code. Extract a helpers to create a command, and the command slice buffer. create_buffer is called only once, but the compiler is smart enough to inline it, and adding it makes the code much