Migration PULL request
Hi
Two small fixes
- Coverity error discovered by Paole that got lost on the track (it is a needed cast).
We got this one in RHEL in the past, so it is not only theoretical.v
- Armbru fix for g_poll() returning one error
Please, apply.
The following changes since commit cf22132367a188426ac07cf1805b214dd2d0cc80:
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2015-12-02 17:05:34 +0000)
are available in the git repository at:
git://github.com/juanquintela/qemu.git tags/migration/20151203
for you to fetch changes up to a694ee343d13159d214823294bbda08e4bdac685:
migration: do floating-point division (2015-12-03 00:03:00 +0100)
----------------------------------------------------------------
migration/next for 20151203
----------------------------------------------------------------
Markus Armbruster (1):
migration: Clean up use of g_poll() in socket_writev_buffer()
Paolo Bonzini (1):
migration: do floating-point division
migration/migration.c | 2 +- migration/qemu-file-unix.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
[Qemu-devel] [PULL 1/2] migration: Clean up use of g_poll() in socket_writev_buffer()
From: Markus Armbruster <[email protected]>
socket_writev_buffer() writes in a loop, using g_poll() to block. If g_poll() fails, it tries to write more before the file descriptor is ready. In theory, this could go into a tight loop. In practice, errors other than EINTR are really unlikely, and when they happen, we're probably screwed anyway, so we can just as well loop.
Clean it up a bit: retry poll on EINTR, keep ignoring other errors.
--- migration/qemu-file-unix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
migration/qemu-file-unix.c +2 -1
@@ -72,7 +72,8 @@ static ssize_t socket_writev_buffer(void *opaque, struct iovec *iov, int iovcnt, pfd.fd = s->fd; pfd.events =G_IO_OUT |G_IO_ERR ; pfd.revents =0 ; -g_poll (&pfd,1 /* 1 fd */ ,-1 /* no timeout */ ); +TFR (err =g_poll (&pfd,1 ,-1 /* no timeout */ )); +/* Errors other than EINTR intentionally ignored */ } }
Signature · 1 line
2.5.0
[Qemu-devel] [PULL 2/2] migration: do floating-point division
In reply to Juan QuintelaFrom: Paolo Bonzini <[email protected]>
Dividing integer expressions transferred_bytes and time_spent, and then converting the integer quotient to type double. Any remainder, or fractional part of the quotient, is ignored. Fix this.
--- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
@@ -1674,7 +1674,7 @@ static void *migration_thread(void *opaque)if (current_time >= initial_time +BUFFER_DELAY ) {uint64_t transferred_bytes =qemu_ftell (s->file) - initial_bytes;uint64_t time_spent = current_time - initial_time; -double bandwidth = transferred_bytes / time_spent; +double bandwidth = (double )transferred_bytes / time_spent; max_size = bandwidth *migrate_max_downtime () /1000000 ; s->mbps = time_spent ? (((double) transferred_bytes * 8.0) /
Signature · 1 line
2.5.0
Peter Maydell
AppliedQuoted 27 lines · Juan Quintela
Hi
Two small fixes
- Coverity error discovered by Paole that got lost on the track (it is a needed cast).
We got this one in RHEL in the past, so it is not only theoretical.v
- Armbru fix forg_poll()returning one errorPlease, apply.
The following changes since commit
cf22132367a188426ac07cf1805b214dd2d0cc80:Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2015-12-02 17:05:34 +0000)
are available in the git repository at:
git://github.com/juanquintela/qemu.gittags/migration/20151203for you to fetch changes up to
a694ee343d13159d214823294bbda08e4bdac685:migration: do floating-point division (2015-12-03 00:03:00 +0100)
----------------------------------------------------------------
migration/next for 20151203
Quoted 6 lines
----------------------------------------------------------------
Markus Armbruster (1):
migration: Clean up use ofg_poll()insocket_writev_buffer()Paolo Bonzini (1):
migration: do floating-point division
Applied, thanks.
-- PMM