From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFnj0-00048s-J1 for qemu-devel@nongnu.org; Mon, 17 Oct 2011 09:59:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFniw-0002Fa-Id for qemu-devel@nongnu.org; Mon, 17 Oct 2011 09:59:30 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:61379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFniw-0002FQ-D3 for qemu-devel@nongnu.org; Mon, 17 Oct 2011 09:59:26 -0400 Received: by ywp17 with SMTP id 17so1218167ywp.4 for ; Mon, 17 Oct 2011 06:59:25 -0700 (PDT) Message-ID: <4E9C34BA.6030207@codemonkey.ws> Date: Mon, 17 Oct 2011 08:59:22 -0500 From: Anthony Liguori MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/36] migration: don't "write" when migration is not active List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 10/11/2011 05:00 AM, Juan Quintela wrote: > If migration is not active, just ignore writes. > > Signed-off-by: Juan Quintela > --- > migration.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/migration.c b/migration.c > index 7ac1fc2..090c925 100644 > --- a/migration.c > +++ b/migration.c > @@ -323,6 +323,10 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size) > FdMigrationState *s = opaque; > ssize_t ret; > > + if (s->state != MIG_STATE_ACTIVE) { > + return -EIO; > + } > + Buffered file is buffered. The migration may complete before the buffer is completely drained. That means additional put_buffer calls may come after the migration state has moved to complete. Regards, Anthony Liguori > do { > ret = s->write(s, data, size); > } while (ret == -1&& ((s->get_error(s)) == EINTR));