Re: [PATCH v2 2/4] iotests: Make qemu_nbd_popen() a contextmanager

2020-08-05 Thread Nir Soffer
On Wed, Aug 5, 2020 at 10:38 AM Vladimir Sementsov-Ogievskiy wrote: > > 28.07.2020 19:05, Nir Soffer wrote: > > On Tue, Jul 28, 2020 at 4:43 PM Vladimir Sementsov-Ogievskiy > > wrote: > >> > >> 28.07.2020 00:58, Nir Soffer wrote: > >>> Instead of duplicating the code to wait until the server is r

Re: [PATCH v2 2/4] iotests: Make qemu_nbd_popen() a contextmanager

2020-08-05 Thread Vladimir Sementsov-Ogievskiy
28.07.2020 19:05, Nir Soffer wrote: On Tue, Jul 28, 2020 at 4:43 PM Vladimir Sementsov-Ogievskiy wrote: 28.07.2020 00:58, Nir Soffer wrote: Instead of duplicating the code to wait until the server is ready and remember to terminate the server and wait for it, make it possible to use like this

Re: [PATCH v2 2/4] iotests: Make qemu_nbd_popen() a contextmanager

2020-07-28 Thread Nir Soffer
On Tue, Jul 28, 2020 at 4:43 PM Vladimir Sementsov-Ogievskiy wrote: > > 28.07.2020 00:58, Nir Soffer wrote: > > Instead of duplicating the code to wait until the server is ready and > > remember to terminate the server and wait for it, make it possible to > > use like this: > > > > with qemu_

Re: [PATCH v2 2/4] iotests: Make qemu_nbd_popen() a contextmanager

2020-07-28 Thread Eric Blake
On 7/28/20 8:42 AM, Vladimir Sementsov-Ogievskiy wrote: 28.07.2020 00:58, Nir Soffer wrote: Instead of duplicating the code to wait until the server is ready and remember to terminate the server and wait for it, make it possible to use like this: with qemu_nbd_popen('-k', sock, image):    

Re: [PATCH v2 2/4] iotests: Make qemu_nbd_popen() a contextmanager

2020-07-28 Thread Vladimir Sementsov-Ogievskiy
28.07.2020 00:58, Nir Soffer wrote: Instead of duplicating the code to wait until the server is ready and remember to terminate the server and wait for it, make it possible to use like this: with qemu_nbd_popen('-k', sock, image): # Access image via qemu-nbd socket... Only test 26

[PATCH v2 2/4] iotests: Make qemu_nbd_popen() a contextmanager

2020-07-27 Thread Nir Soffer
Instead of duplicating the code to wait until the server is ready and remember to terminate the server and wait for it, make it possible to use like this: with qemu_nbd_popen('-k', sock, image): # Access image via qemu-nbd socket... Only test 264 used this helper, but I had to modify