diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-12-03 10:43:43 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-12-03 10:43:43 +0000 |
commit | eab0ebc7fe3662ebb4348ac763e7aabc7e355566 (patch) | |
tree | 16cb298fdd905974c30e26f989b3b8f5bfae8da3 | |
parent | ec1b9aa89d7970c7edc9594c33206690f5ba3c87 (diff) | |
parent | a694ee343d13159d214823294bbda08e4bdac685 (diff) |
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20151203' into staging
migration/next for 20151203
# gpg: Signature made Wed 02 Dec 2015 23:19:10 GMT using RSA key ID 5872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>"
# gpg: aka "Juan Quintela <quintela@trasno.org>"
* remotes/juanquintela/tags/migration/20151203:
migration: do floating-point division
migration: Clean up use of g_poll() in socket_writev_buffer()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | migration/migration.c | 2 | ||||
-rw-r--r-- | migration/qemu-file-unix.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/migration/migration.c b/migration/migration.c index 1a42aee412..adc6b6f1c9 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -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) / diff --git a/migration/qemu-file-unix.c b/migration/qemu-file-unix.c index c503b027a9..6ca53e7d67 100644 --- a/migration/qemu-file-unix.c +++ b/migration/qemu-file-unix.c @@ -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 */ } } |