From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIOEy-000703-Gt for qemu-devel@nongnu.org; Wed, 20 Mar 2013 15:00:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIOEw-0002tg-RJ for qemu-devel@nongnu.org; Wed, 20 Mar 2013 15:00:00 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:37172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIOEw-0002tW-9o for qemu-devel@nongnu.org; Wed, 20 Mar 2013 14:59:58 -0400 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Mar 2013 04:51:37 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id DFE81357804A for ; Thu, 21 Mar 2013 05:59:50 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2KIxDQi4522466 for ; Thu, 21 Mar 2013 05:59:13 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2KIxHTu021137 for ; Thu, 21 Mar 2013 05:59:17 +1100 From: Anthony Liguori In-Reply-To: <1499817252.12085108.1363799121160.JavaMail.root@redhat.com> References: <1499817252.12085108.1363799121160.JavaMail.root@redhat.com> Date: Wed, 20 Mar 2013 13:59:10 -0500 Message-ID: <87boadc2yp.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 1/4] char: add a post_load callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: amit shah , hdegoede@redhat.com, kraxel@redhat.com, qemu-devel@nongnu.org Alon Levy writes: >> Alon Levy writes: >> >> > 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); >> >> The character device layer should *not* be messing around with >> notifying >> migration state. >> >> I thought we previously discussed this? Just implement a migration >> hook >> in the spice code. > > The thing Gerd objected to when I sent a patch doing just that was the > way I used the vmstate, one possible way to not have to use vmstate at > all is adding api for querying the current front end connected status, > like qemu_fe_is_connected. Is that acceptable? To determine if the backend is connected? If so, it's fine, but I'd suggest being more explicit and calling it qemu_fe_is_be_connected(). Regards, Anthony Liguori > >> >> Regards, >> >> Anthony Liguori >> >> > 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) { >> > -- >> > 1.8.1.4 >> >> >>