From patchwork Wed Mar 20 09:55:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 229301 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DFE822C00B9 for ; Wed, 20 Mar 2013 20:58:29 +1100 (EST) Received: from localhost ([::1]:45765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIFms-0001i3-OK for incoming@patchwork.ozlabs.org; Wed, 20 Mar 2013 05:58:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIFjv-0005om-9U for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIFjt-00027W-Sb for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:55:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIFjt-000274-Is for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:55:21 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2K9tKEg007126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Mar 2013 05:55:20 -0400 Received: from localhost.localdomain (vpn1-4-179.ams2.redhat.com [10.36.4.179]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2K9tFGI019828; Wed, 20 Mar 2013 05:55:18 -0400 From: Alon Levy To: qemu-devel@nongnu.org Date: Wed, 20 Mar 2013 11:55:11 +0200 Message-Id: <1363773314-32332-2-git-send-email-alevy@redhat.com> In-Reply-To: <1363773314-32332-1-git-send-email-alevy@redhat.com> References: <1363773314-32332-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: amit.shah@redhat.com, hdegoede@redhat.com, aliguori@us.ibm.com, kraxel@redhat.com Subject: [Qemu-devel] [PATCH 1/4] char: add a post_load callback X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Alon Levy --- include/char/char.h | 12 ++++++++++++ qemu-char.c | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/include/char/char.h b/include/char/char.h index 0326b2a..0fdcaf9 100644 --- a/include/char/char.h +++ b/include/char/char.h @@ -70,6 +70,7 @@ struct CharDriverState { void (*chr_set_echo)(struct CharDriverState *chr, bool echo); void (*chr_guest_open)(struct CharDriverState *chr); void (*chr_guest_close)(struct CharDriverState *chr); + void (*chr_post_load)(struct CharDriverState *chr, int connected); void *opaque; int idle_tag; char *label; @@ -144,6 +145,17 @@ void qemu_chr_fe_open(struct CharDriverState *chr); void qemu_chr_fe_close(struct CharDriverState *chr); /** + * @qemu_chr_fe_post_load: + * + * Indicate to backend that a migration has just completed. Must be called when + * the vm is in the running state. + * + * @connected true if frontend is still connected after migration, false + * otherwise. + */ +void qemu_chr_fe_post_load(struct CharDriverState *chr, int connected); + +/** * @qemu_chr_fe_printf: * * Write to a character backend using a printf style interface. diff --git a/qemu-char.c b/qemu-char.c index 4e011df..42c911f 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3390,6 +3390,13 @@ void qemu_chr_fe_open(struct CharDriverState *chr) } } +void qemu_chr_fe_post_load(struct CharDriverState *chr, int connected) +{ + if (chr->chr_post_load) { + chr->chr_post_load(chr, connected); + } +} + void qemu_chr_fe_close(struct CharDriverState *chr) { if (chr->chr_guest_close) {