From: Anthony Liguori <aliguori@us.ibm.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: amit.shah@redhat.com, hdegoede@redhat.com,
Alon Levy <alevy@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected
Date: Fri, 22 Mar 2013 08:33:49 -0500 [thread overview]
Message-ID: <871ub7woci.fsf@codemonkey.ws> (raw)
In-Reply-To: <514C158C.7050001@redhat.com>
Gerd Hoffmann <kraxel@redhat.com> writes:
> Hi,
>
>> There isn't a notion of "connected" for the front-ends in the char
>> layer. The closest thing is whether add_handlers() have been called or
>> not.
>
> It isn't new. There are qemu_chr_fe_open + qemu_chr_fe_close doing
> exactly that signaling (whenever someone has opened the virtio-serial
> port, i.e. whenever the guest agent is active or not).
anthony@titi:~/git/qemu$ find -name "*.[ch]" -exec grep -l qemu_chr_fe_open {} \;
./qemu-char.c
./hw/virtio-console.c
./hw/usb/redirect.c
./include/char/char.h
And:
anthony@titi:~/git/qemu$ find . -name "*.[ch]" -exec grep -l chr_guest_open {} \;
./qemu-char.c
./include/char/char.h
./spice-qemu-char.c
So this whole interface exists specificially for the spice-qemu-char
backend and only for that backend. This isn't a generic char layer
concept. It's a thinly veiled call into spice.
Now spice appears to have a work around in it where the first write will
trigger affectively the same action as doing an open. Presumably this
makes it usable with !virtio-serial or !usb-redir.
If we want to extend this concept of fe open, let's do it right. Let's
make all char frontends explicitly open, close on reset, etc.
Let's do something that makes sense across the board.
>
> Problem is the chardev forgets this state over migration.
>
> So we need a way to restore the state. virtio-serial knows it of course
> as this is guest state it has to keep track of it. We just need a way
> the chardev can figure what the current state is after migration.
>
> The options I see:
>
> (1) Have chardev store the state itself in a new migration section.
> This is what I've NAK'ed. First, because live-migration host
> state is a can of worms I don't want open. Second because it
> actually isn't host state.
>
> (2) virtio-serial could just call qemu_chr_fe_open in
> post_migration hook. Could have unwanted side effects as
> the chardev can't figure whenever this is a post-load call
> or a guest-open call.
The only implementation of qemu_chr_fe_open() is:
static void spice_chr_guest_open(struct CharDriverState *chr)
{
SpiceCharDriver *s = chr->opaque;
vmc_register_interface(s);
}
Is this what you would do anyway?
In a world where qemu_chr_fe_open() was actually used throughout the
device model, all devices would need to have a post_load()
implementation where they checked their state to determine whether to
generate an open() call.
Regards,
Anthony Liguori
>
> (3) Add a new qemu_chr_fe_* call for virtio-serial to notify the
> chardev. This was the next proposal from Alon
>
> (4) Do it the other way around: Allow the chardev query what the
> current state is. This patch series.
>
> (5) Cut off the chardev layer altogether and implement spicevmc as
> virtio-serial port. Your proposal if I understand it correctly.
> Makes sense, but breaks backward compatibility, so even when
> doing this we must fix the chardev spicevmc bug somehow.
>
> Hope this clarifies,
> Gerd
next prev parent reply other threads:[~2013-03-22 13:34 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-20 9:55 [Qemu-devel] [PATCH v2 0/4] for spice post load char device hook Alon Levy
2013-03-20 9:55 ` [Qemu-devel] [PATCH 1/4] char: add a post_load callback Alon Levy
2013-03-20 13:08 ` Anthony Liguori
2013-03-20 16:59 ` Alon Levy
2013-03-21 6:53 ` Gerd Hoffmann
2013-03-21 8:54 ` Alon Levy
2013-03-20 17:05 ` Alon Levy
2013-03-20 18:59 ` Anthony Liguori
2013-03-21 8:27 ` Hans de Goede
2013-03-21 8:36 ` Hans de Goede
2013-03-21 16:35 ` [Qemu-devel] [PATCH v3 0/2] spice-qemu-char fix agent mouse after migration Alon Levy
2013-03-21 16:35 ` [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected Alon Levy
2013-03-21 18:18 ` Anthony Liguori
2013-03-21 18:35 ` Alon Levy
2013-03-21 19:24 ` Anthony Liguori
2013-03-21 21:55 ` Alon Levy
2013-03-21 22:05 ` Alon Levy
2013-03-22 7:56 ` Hans de Goede
2013-03-22 13:50 ` Anthony Liguori
2013-03-22 15:53 ` Gerd Hoffmann
2013-03-22 16:50 ` Hans de Goede
2013-03-22 17:11 ` Anthony Liguori
2013-03-24 12:37 ` Hans de Goede
2013-03-22 8:25 ` Gerd Hoffmann
2013-03-22 8:58 ` Hans de Goede
2013-03-22 13:33 ` Anthony Liguori [this message]
2013-03-21 16:35 ` [Qemu-devel] [PATCH 2/2] spice-qemu-char: register interface on post load Alon Levy
2013-03-22 8:07 ` Hans de Goede
2013-03-22 8:16 ` Alon Levy
2013-03-22 8:55 ` Hans de Goede
2013-03-20 9:55 ` [Qemu-devel] [PATCH 2/4] virtio-serial: add a post_load callback implemented by port Alon Levy
2013-03-20 9:55 ` [Qemu-devel] [PATCH 3/4] virtio-console: implement post_load to call to qemu_chr_fe_post_load Alon Levy
2013-03-20 9:55 ` [Qemu-devel] [PATCH 4/4] spice-qemu-char: register interface on post load Alon Levy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871ub7woci.fsf@codemonkey.ws \
--to=aliguori@us.ibm.com \
--cc=alevy@redhat.com \
--cc=amit.shah@redhat.com \
--cc=hdegoede@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).