* [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 @ 2017-08-02 9:41 Peter Xu 2017-08-02 9:41 ` [Qemu-devel] [PATCH v2 1/2] migration: fix comment disorder in RAMState Peter Xu ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Peter Xu @ 2017-08-02 9:41 UTC (permalink / raw) To: qemu-devel Cc: Laurent Vivier, Juan Quintela, Daniel P . Berrange, peterx, Dr . David Alan Gilbert v2: - patch 2: move trace_*() after error_setg_errno(). [Dan] Two patches isolated from the postcopy recovery series, which may be good for 2.10. Peter Xu (2): migration: fix comment disorder in RAMState io: fix qio_channel_socket_accept err handling io/channel-socket.c | 3 ++- migration/ram.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- 2.7.4 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH v2 1/2] migration: fix comment disorder in RAMState 2017-08-02 9:41 [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 Peter Xu @ 2017-08-02 9:41 ` Peter Xu 2017-08-02 9:41 ` [Qemu-devel] [PATCH v2 2/2] io: fix qio_channel_socket_accept err handling Peter Xu 2017-08-02 10:29 ` [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 Dr. David Alan Gilbert 2 siblings, 0 replies; 5+ messages in thread From: Peter Xu @ 2017-08-02 9:41 UTC (permalink / raw) To: qemu-devel Cc: Laurent Vivier, Juan Quintela, Daniel P . Berrange, peterx, Dr . David Alan Gilbert Comments for "migration_dirty_pages" and "bitmap_mutex" are switched. Fix it. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> --- migration/ram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 1b08296..e18b3e2 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -188,9 +188,9 @@ struct RAMState { uint64_t iterations_prev; /* Iterations since start */ uint64_t iterations; - /* protects modification of the bitmap */ - uint64_t migration_dirty_pages; /* number of dirty bits in the bitmap */ + uint64_t migration_dirty_pages; + /* protects modification of the bitmap */ QemuMutex bitmap_mutex; /* The RAMBlock used in the last src_page_requests */ RAMBlock *last_req_rb; -- 2.7.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH v2 2/2] io: fix qio_channel_socket_accept err handling 2017-08-02 9:41 [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 Peter Xu 2017-08-02 9:41 ` [Qemu-devel] [PATCH v2 1/2] migration: fix comment disorder in RAMState Peter Xu @ 2017-08-02 9:41 ` Peter Xu 2017-08-02 9:42 ` Daniel P. Berrange 2017-08-02 10:29 ` [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 Dr. David Alan Gilbert 2 siblings, 1 reply; 5+ messages in thread From: Peter Xu @ 2017-08-02 9:41 UTC (permalink / raw) To: qemu-devel Cc: Laurent Vivier, Juan Quintela, Daniel P . Berrange, peterx, Dr . David Alan Gilbert When accept failed, we should setup errp with the reason. More importantly, the caller may assume errp be non-NULL when error happens, and not setting the errp may crash QEMU. At the same time, move the trace_qio_channel_socket_accept_fail() after the if check on EINTR. Two reasons: 1. when EINTR happened, it's not really a fault (we should just try again), so we should not log with an "accept failure". 2. trace_*() functions may overwrite errno, then the old errno will be missing. We need to either check errno before trace_*() calls, or reserve the errno. Signed-off-by: Peter Xu <peterx@redhat.com> --- io/channel-socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io/channel-socket.c b/io/channel-socket.c index 53386b7..591d27e 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -340,10 +340,11 @@ qio_channel_socket_accept(QIOChannelSocket *ioc, cioc->fd = qemu_accept(ioc->fd, (struct sockaddr *)&cioc->remoteAddr, &cioc->remoteAddrLen); if (cioc->fd < 0) { - trace_qio_channel_socket_accept_fail(ioc); if (errno == EINTR) { goto retry; } + error_setg_errno(errp, errno, "Unable to accept connection"); + trace_qio_channel_socket_accept_fail(ioc); goto error; } -- 2.7.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2 2/2] io: fix qio_channel_socket_accept err handling 2017-08-02 9:41 ` [Qemu-devel] [PATCH v2 2/2] io: fix qio_channel_socket_accept err handling Peter Xu @ 2017-08-02 9:42 ` Daniel P. Berrange 0 siblings, 0 replies; 5+ messages in thread From: Daniel P. Berrange @ 2017-08-02 9:42 UTC (permalink / raw) To: Peter Xu; +Cc: qemu-devel, Laurent Vivier, Juan Quintela, Dr . David Alan Gilbert On Wed, Aug 02, 2017 at 05:41:20PM +0800, Peter Xu wrote: > When accept failed, we should setup errp with the reason. More > importantly, the caller may assume errp be non-NULL when error happens, > and not setting the errp may crash QEMU. > > At the same time, move the trace_qio_channel_socket_accept_fail() after > the if check on EINTR. Two reasons: > > 1. when EINTR happened, it's not really a fault (we should just try > again), so we should not log with an "accept failure". > > 2. trace_*() functions may overwrite errno, then the old errno will be > missing. We need to either check errno before trace_*() calls, or > reserve the errno. > > Signed-off-by: Peter Xu <peterx@redhat.com> > --- > io/channel-socket.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/io/channel-socket.c b/io/channel-socket.c > index 53386b7..591d27e 100644 > --- a/io/channel-socket.c > +++ b/io/channel-socket.c > @@ -340,10 +340,11 @@ qio_channel_socket_accept(QIOChannelSocket *ioc, > cioc->fd = qemu_accept(ioc->fd, (struct sockaddr *)&cioc->remoteAddr, > &cioc->remoteAddrLen); > if (cioc->fd < 0) { > - trace_qio_channel_socket_accept_fail(ioc); > if (errno == EINTR) { > goto retry; > } > + error_setg_errno(errp, errno, "Unable to accept connection"); > + trace_qio_channel_socket_accept_fail(ioc); > goto error; > } Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 2017-08-02 9:41 [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 Peter Xu 2017-08-02 9:41 ` [Qemu-devel] [PATCH v2 1/2] migration: fix comment disorder in RAMState Peter Xu 2017-08-02 9:41 ` [Qemu-devel] [PATCH v2 2/2] io: fix qio_channel_socket_accept err handling Peter Xu @ 2017-08-02 10:29 ` Dr. David Alan Gilbert 2 siblings, 0 replies; 5+ messages in thread From: Dr. David Alan Gilbert @ 2017-08-02 10:29 UTC (permalink / raw) To: Peter Xu; +Cc: qemu-devel, Laurent Vivier, Juan Quintela, Daniel P . Berrange * Peter Xu (peterx@redhat.com) wrote: > v2: > - patch 2: move trace_*() after error_setg_errno(). [Dan] > > Two patches isolated from the postcopy recovery series, which may be > good for 2.10. Queued > Peter Xu (2): > migration: fix comment disorder in RAMState > io: fix qio_channel_socket_accept err handling > > io/channel-socket.c | 3 ++- > migration/ram.c | 4 ++-- > 2 files changed, 4 insertions(+), 3 deletions(-) > > -- > 2.7.4 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-08-02 10:29 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-08-02 9:41 [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 Peter Xu 2017-08-02 9:41 ` [Qemu-devel] [PATCH v2 1/2] migration: fix comment disorder in RAMState Peter Xu 2017-08-02 9:41 ` [Qemu-devel] [PATCH v2 2/2] io: fix qio_channel_socket_accept err handling Peter Xu 2017-08-02 9:42 ` Daniel P. Berrange 2017-08-02 10:29 ` [Qemu-devel] [PATCH v2 0/2] migration: fixes for 2.10 Dr. David Alan Gilbert
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).