Re: [Qemu-block] [PATCH v2] rbd: make the code more readable

2016-10-16 Thread Stefan Hajnoczi
On Sat, Oct 15, 2016 at 04:26:13PM +0800, Xiubo Li wrote: > Make it a bit clearer and more readable. > > Signed-off-by: Xiubo Li > CC: John Snow > --- > > V2: > - Advice from John Snow. Thanks. > > > block/rbd.c | 25 -

Re: [Qemu-block] [PATCH 18/18] aio: convert from RFifoLock to QemuRecMutex

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:22PM +0200, Paolo Bonzini wrote: > It is simpler and a bit faster, and QEMU does not need the contention > callbacks (and thus the fairness) anymore. > > Reviewed-by: Fam Zheng > Signed-off-by: Paolo Bonzini > --- > async.c

Re: [Qemu-block] [PATCH 15/18] block: only call aio_poll on the current thread's AioContext

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:19PM +0200, Paolo Bonzini wrote: > aio_poll is not thread safe; for example bdrv_drain can hang if > the last in-flight I/O operation is completed in the I/O thread after > the main thread has checked bs->in_flight. > > The bug remains latent as long as all of it is

Re: [Qemu-block] [Qemu-devel] [PATCH 13/18] replication: pass BlockDriverState to reopen_backing_file

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:17PM +0200, Paolo Bonzini wrote: > This will be needed in the next patch to retrieve the AioContext. > > Signed-off-by: Paolo Bonzini > --- > block/replication.c | 21 - > 1 file changed, 12 insertions(+), 9 deletions(-)

Re: [Qemu-block] [PATCH 14/18] block: prepare bdrv_reopen_multiple to release AioContext

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:18PM +0200, Paolo Bonzini wrote: > After the next patch bdrv_drain_all will have to be called without holding any > AioContext. Prepare to do this by adding an AioContext argument to > bdrv_reopen_multiple. > > Signed-off-by: Paolo Bonzini >

Re: [Qemu-block] [PATCH 11/18] aio: introduce qemu_get_current_aio_context

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:15PM +0200, Paolo Bonzini wrote: > This will be used by bdrv_poll_while (and thus by bdrv_drain) > to choose how to wait for I/O completion. > > Reviewed-by: Fam Zheng > Signed-off-by: Paolo Bonzini > --- > include/block/aio.h

Re: [Qemu-block] [PATCH 10/18] sheepdog: use bdrv_poll_while and bdrv_wakeup

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:14PM +0200, Paolo Bonzini wrote: > These ensure that bdrv_poll_while will exit for a BlockDriverState > that is not in the main AioContext. > > Signed-off-by: Paolo Bonzini > --- > block/sheepdog.c | 67 >

Re: [Qemu-block] [PATCH 09/18] nfs: use bdrv_poll_while and bdrv_wakeup

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:13PM +0200, Paolo Bonzini wrote: > These will make it possible to use nfs_get_allocated_file_size on > a file that is not in the main AioContext. > > Signed-off-by: Paolo Bonzini > --- > block/nfs.c | 47

Re: [Qemu-block] [PATCH 08/18] nfs: move nfs_set_events out of the while loops

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:12PM +0200, Paolo Bonzini wrote: > nfs_set_events only needs to be called once before entering the > while loop; afterwards, nfs_process_read and nfs_process_write > take care of it. > > Signed-off-by: Paolo Bonzini > --- > block/nfs.c | 8

Re: [Qemu-block] [PATCH 07/18] block: introduce bdrv_poll_while and bdrv_wakeup

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:11PM +0200, Paolo Bonzini wrote: > @@ -485,9 +474,14 @@ void bdrv_inc_in_flight(BlockDriverState *bs) > atomic_inc(>in_flight); > } > > +void bdrv_wakeup(BlockDriverState *bs) > +{ > +} Please write a doc comment explaining the semantics of this new API.

Re: [Qemu-block] [PATCH 02/18] blockjob: introduce .drain callback for jobs

2016-10-16 Thread Stefan Hajnoczi
On Thu, Oct 13, 2016 at 07:34:06PM +0200, Paolo Bonzini wrote: > +static void backup_drain(BlockJob *job) > +{ > +BackupBlockJob *s = container_of(job, BackupBlockJob, common); > + > +/* Need to keep a reference in case blk_drain triggers execution > + * of backup_complete... > +

Re: [Qemu-block] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-16 Thread Ashijeet Acharya
>>> /* Check the remote host's key against known_hosts. */ >>> -ret = check_host_key(s, host, port, host_key_check, errp); >>> +ret = check_host_key(s, s->inet->host, port, host_key_check, >> >> But then you're still using the port here... And I can't come up with a >> way (not even a

Re: [Qemu-block] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-16 Thread Ashijeet Acharya
On Sun, Oct 16, 2016 at 4:00 AM, Max Reitz wrote: > On 15.10.2016 11:04, Ashijeet Acharya wrote: >> Add InetSocketAddress compatibility to SSH driver. >> >> Add a new option "server" to the SSH block driver which then accepts >> a InetSocketAddress. >> >> "host" and "port" are