qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH 10/13] migration: move exit condition to migration thread
Date: Thu, 17 Jan 2013 14:39:30 +0100	[thread overview]
Message-ID: <1358429973-9321-11-git-send-email-quintela@redhat.com> (raw)
In-Reply-To: <1358429973-9321-1-git-send-email-quintela@redhat.com>

Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 migration.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/migration.c b/migration.c
index 17eb27d..651edd5 100644
--- a/migration.c
+++ b/migration.c
@@ -669,12 +669,6 @@ static bool migrate_fd_put_ready(MigrationState *s, uint64_t max_size)
     bool last_round = false;

     qemu_mutex_lock_iothread();
-    if (s->state != MIG_STATE_ACTIVE) {
-        DPRINTF("put_ready returning because of non-active state\n");
-        qemu_mutex_unlock_iothread();
-        return false;
-    }
-
     DPRINTF("iterate\n");
     pending_size = qemu_savevm_state_pending(s->file, max_size);
     DPRINTF("pending size %lu max %lu\n", pending_size, max_size);
@@ -737,9 +731,17 @@ static void *buffered_file_thread(void *opaque)
     while (true) {
         int64_t current_time = qemu_get_clock_ms(rt_clock);

+        qemu_mutex_lock_iothread();
+        if (s->state != MIG_STATE_ACTIVE) {
+            DPRINTF("put_ready returning because of non-active state\n");
+            qemu_mutex_unlock_iothread();
+            break;
+        }
         if (s->complete) {
+            qemu_mutex_unlock_iothread();
             break;
         }
+        qemu_mutex_unlock_iothread();
         if (current_time >= initial_time + BUFFER_DELAY) {
             uint64_t transferred_bytes = s->bytes_xfer;
             uint64_t time_spent = current_time - initial_time;
-- 
1.8.1

  parent reply	other threads:[~2013-01-17 13:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17 13:39 [Qemu-devel] [PULL 00/13] thread queue Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 01/13] Unlock ramlist lock also in error case Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 02/13] Protect migration_bitmap_sync() with the ramlist lock Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 03/13] use XFER_LIMIT_RATIO consistently Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 04/13] migration: make function static Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 05/13] migration: remove double call to migrate_fd_close Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 06/13] migration: fix off-by-one in buffered_rate_limit Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 07/13] qemu-file: Only set last_error if it is not already set Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 08/13] migration: move beginning stage to the migration thread Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 09/13] migration: Add buffered_flush error handling Juan Quintela
2013-01-17 13:39 ` Juan Quintela [this message]
2013-01-17 13:39 ` [Qemu-devel] [PATCH 11/13] migration: unfold rest of migrate_fd_put_ready() into thread Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 12/13] migration: Only go to the iterate stage if there is anything to send Juan Quintela
2013-01-17 13:39 ` [Qemu-devel] [PATCH 13/13] migration: remove argument to qemu_savevm_state_cancel Juan Quintela
2013-01-17 15:22 ` [Qemu-devel] [PULL 00/13] thread queue Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358429973-9321-11-git-send-email-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).