From patchwork Sun Aug 21 20:58:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Md Haris Iqbal X-Patchwork-Id: 9292711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 54289607FF for ; Sun, 21 Aug 2016 21:03:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 380FE28971 for ; Sun, 21 Aug 2016 21:03:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C2FE28989; Sun, 21 Aug 2016 21:03:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A63CF28971 for ; Sun, 21 Aug 2016 21:03:27 +0000 (UTC) Received: from localhost ([::1]:38186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbZtu-0001jL-KG for patchwork-qemu-devel@patchwork.kernel.org; Sun, 21 Aug 2016 17:03:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbZpt-0007Rc-G5 for qemu-devel@nongnu.org; Sun, 21 Aug 2016 16:59:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbZpr-0005ya-KZ for qemu-devel@nongnu.org; Sun, 21 Aug 2016 16:59:16 -0400 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:36859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbZpr-0005yU-Ds for qemu-devel@nongnu.org; Sun, 21 Aug 2016 16:59:15 -0400 Received: by mail-pa0-x242.google.com with SMTP id ez1so6813266pab.3 for ; Sun, 21 Aug 2016 13:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9TCB04YpukOMfvLpSqsa8Pr3xYDS7xJU9gvqEXxWCHI=; b=tBOkDBFLPz3yorHse7gVgMoo1pBDexgPqioDlg6X3mQqlMW+dN7glmLr3u/dWtfxqL +F4u1rG4+BGC4nCNaJk8ykhCp49C9jb8QaFO4FIy7HtVRJV/xUAx7Yk4xGgLKGYqWcR2 ki3Ea/jDG08beQ4rYgqb91xNG4rROjnuyztOAb+XfIPvrkSkXMjgoXt1FWUdGZJH/sPL 6VqU3fAjnpx7sCfw9n3Zz7Jj80OtM/N8XO8Cw/czEzEHzBKMw1FUbPlAVzEgbl/rds8i hjD0hx8f7JklZMgMrMgxEJtZMIs6QbS5fWyMRfSPhgPy802FVBLlimz4Dg43AgzHMnbU bgoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9TCB04YpukOMfvLpSqsa8Pr3xYDS7xJU9gvqEXxWCHI=; b=H6jtzBEauIsZx4X/cfzKplPdrNJu/TR4uCpBWKTV8BW+MOEWkaG2ZGU8+pPvKuNmss tJzOR4pYNIyiy8ec8LNwSCnYuAVauOqcG/iQOMODYZuHN5nBw2bfT6wttxJj3parF7Vp b7yLKRnvCog3i6ZXNS+64KlWcZd4ogg8SAnZQN4kabdAD/IycCofy2U7gjiFcgwyTwLb 3TV8giUr/Iz2YmnGTtevjBu9VTHQNi6O/Cf7FAk3ld2LoXHkShNYFmpkYBqWoiGHBHlq YsYNWCoVfkhNWQGNK+HVfbmGVbFWYCyRRFlDA6RJMbdzqROM7HhdMzfHRIXDSlCEOXUU wbrQ== X-Gm-Message-State: AEkoousqtQeW5I0cAndekhXQ0QE0SEeYDevjoq1Z83phbpGhv8nCqLo2YQUOQzATyomWSQ== X-Received: by 10.66.82.3 with SMTP id e3mr35496818pay.54.1471813154575; Sun, 21 Aug 2016 13:59:14 -0700 (PDT) Received: from deepak.domain.name ([103.252.25.179]) by smtp.googlemail.com with ESMTPSA id ra13sm27025890pac.29.2016.08.21.13.59.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Aug 2016 13:59:13 -0700 (PDT) From: Md Haris Iqbal To: qemu-devel@nongnu.org Date: Mon, 22 Aug 2016 02:28:48 +0530 Message-Id: <1471813132-13836-3-git-send-email-haris.phnx@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471813132-13836-1-git-send-email-haris.phnx@gmail.com> References: <1471813132-13836-1-git-send-email-haris.phnx@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::242 Subject: [Qemu-devel] [PATCH 2/6] migration : General additions for migration recovery X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Md Haris Iqbal , dgilbert@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Md Haris Iqbal --- include/migration/qemu-file.h | 1 + migration/migration.c | 3 +++ migration/qemu-file.c | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h index abedd46..56a51b9 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -181,6 +181,7 @@ void qemu_file_set_rate_limit(QEMUFile *f, int64_t new_rate); int64_t qemu_file_get_rate_limit(QEMUFile *f); int qemu_file_get_error(QEMUFile *f); void qemu_file_set_error(QEMUFile *f, int ret); +void qemu_file_clear_error(QEMUFile *f); int qemu_file_shutdown(QEMUFile *f); QEMUFile *qemu_file_get_return_path(QEMUFile *f); void qemu_fflush(QEMUFile *f); diff --git a/migration/migration.c b/migration/migration.c index 6ed2e82..149cf1e 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -63,6 +63,9 @@ static NotifierList migration_state_notifiers = static bool deferred_incoming; +static QemuMutex migration_recovery_mutex; +static QemuCond migration_recovery_cond; + /* * Current state of incoming postcopy; note this is not part of * MigrationIncomingState since it's state is used during cleanup diff --git a/migration/qemu-file.c b/migration/qemu-file.c index e9fae31..60e53c9 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -127,6 +127,11 @@ void qemu_file_set_error(QEMUFile *f, int ret) } } +void qemu_file_clear_error(QEMUFile *f) +{ + f->last_error = 0; +} + bool qemu_file_is_writable(QEMUFile *f) { return f->ops->writev_buffer;