From: Gerd Hoffmann <kraxel@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Amit Shah <amit.shah@redhat.com>,
Anthony Liguori <aliguori@redhat.com>,
Alon Levy <alevy@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] RFC adding ioctl's to virtserial/virtconsole
Date: Tue, 03 Aug 2010 18:42:05 +0200 [thread overview]
Message-ID: <4C5846DD.90209@redhat.com> (raw)
In-Reply-To: <4C5839D0.1060109@codemonkey.ws>
Hi,
>> /me wonders what the point of the 'backlog' struct element is then.
>
> Because it could be used for host event but let's ignore that for now.
I doubt using the same beast for both host and guest is going to fly ...
>> Yes, we can do that. I don't think it is useful. Oh, and it also
>> changes the command line interface. Todays ...
>>
>> qemu -chardev soemthing,id=foo \
>> -device virtserport,chardev=foo
>>
>> ... would turn into something like ...
>>
>> qemu -chardev something,if=foo \
>> -charsrv simple,chardev=foo,id=bar \
>> -device virtserport,charsrv=bar
>
> If we think this is useful, then we can find a way to make the command
> line syntax work. If we don't think it's useful, then there's no point
> in doing it.
Well, when using the new model everythere this is a moot point as
-chardev would just define a CharServerState instead of a
CharDriverState then.
>>> Spice would then implement it's own CharServerState and would use it to
>>> understand what state the session is in.
>>
>> Spice would basically (ab-)use it as event delivery mechanism.
>
> Can you explain what spice uses these events for?
spice-vmc code registers/unregisters the interface within the spice
server. So the interface is only activated in case the guest uses it.
Spice client sees the interface being active or not and can act accordingly.
http://cgit.freedesktop.org/spice/qemu/tree/hw/spice-vmc.c?h=spice.v13#n128
>> Well. I disagree. Checking the state is needed nevertheless. The
>> places where virtio-serial checks port->state today it would have to
>> check whenever port->chardev is non-NULL then. The only difference is
>> that failures to do so might become a bit more obvious as qemu will
>> segfault due to the NULL pointer dereferences then. I still think this
>> isn't worth the effort though.
>
> But I think we ultimately need to switch to having the front-ends having
> a NULL check. Even beyond front-end initiated connect/disconnect,
> front-end's need to learn to deal with back-end initiated
> disconnect/connect.
I don't think we have to go with a NULL check. Providing chr_is_*()
functions to query state and adding asserts() to the chr_*() function
should provide the same level of robustness IMHO. Also having
CharDriverStates come and go brings its own share of problems.
> If you look at something like the serial device's chardev usage, right
> now, it writes to the stream regardless of whether the back-end is
> connected and we have different semantics in each backend about what we
> do. It would be far better to just expose the fact that the backend
> isn't connected to the device such that it can either present that to
> the guest or make it's own decision about what to do.
Indeed.
> I think the model where we always write to a chardev is fundamentally
> broken. Sending life cycle events over an always open stream is even
> more broken and I think it's a good opportunity to introduce life cycle
> awareness into the API (especially since it can be done as a pretty
> small incremental change).
The chardevs API can use a major overhaul, no question. I doubt that
creating CharServerState helps here much though. Especially I don't see
how that could be used for *both* Host and Guest side.
cheers,
Gerd
next prev parent reply other threads:[~2010-08-03 16:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <183307416.602861280770002326.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-08-02 17:28 ` [Qemu-devel] RFC adding ioctl's to virtserial/virtconsole Alon Levy
2010-08-02 17:42 ` Anthony Liguori
2010-08-03 8:46 ` Gerd Hoffmann
2010-08-03 13:12 ` Anthony Liguori
2010-08-03 15:28 ` Gerd Hoffmann
2010-08-03 15:46 ` Anthony Liguori
2010-08-03 16:42 ` Gerd Hoffmann [this message]
2010-08-03 16:45 ` Anthony Liguori
2010-08-03 17:02 ` Gerd Hoffmann
2010-08-03 17:53 ` Anthony Liguori
2010-08-03 20:41 ` Gerd Hoffmann
2010-08-03 20:45 ` Anthony Liguori
[not found] <391834624.690531280844685997.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-08-03 14:13 ` Alon Levy
[not found] <2092558519.524651280737489312.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-08-02 8:33 ` Alon Levy
2010-08-02 9:03 ` Amit Shah
2010-08-02 15:04 ` Anthony Liguori
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=4C5846DD.90209@redhat.com \
--to=kraxel@redhat.com \
--cc=alevy@redhat.com \
--cc=aliguori@redhat.com \
--cc=amit.shah@redhat.com \
--cc=anthony@codemonkey.ws \
--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).