From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIaml-0004kS-Ox for qemu-devel@nongnu.org; Thu, 21 Mar 2013 04:23:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIamk-00076Y-Hr for qemu-devel@nongnu.org; Thu, 21 Mar 2013 04:23:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIamk-00076T-AB for qemu-devel@nongnu.org; Thu, 21 Mar 2013 04:23:42 -0400 Message-ID: <514AC455.4080900@redhat.com> Date: Thu, 21 Mar 2013 09:27:01 +0100 From: Hans de Goede MIME-Version: 1.0 References: <1499817252.12085108.1363799121160.JavaMail.root@redhat.com> <87boadc2yp.fsf@codemonkey.ws> In-Reply-To: <87boadc2yp.fsf@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Anthony Liguori Cc: amit shah , Alon Levy , kraxel@redhat.com, qemu-devel@nongnu.org Hi, On 03/20/2013 07:59 PM, Anthony Liguori wrote: > 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? No to query if the front-end is connected to the guest, with virtio-ports just because they are there does not mean the guest is listening, so qemu_fe_is_connected is the right name, or maybe qemu_fe_is_guest_connected If so, it's fine, but I'd > suggest being more explicit and calling it qemu_fe_is_be_connected(). Definitely not qemu_fe_is_be_connected that would mean asking if a chardev backend is connected, which is not what we're interested in (we're calling this from a backend, so we know we're connected ourselves). Regards, Hans