All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v9 04/17] vnc: hoist allocation of VncBasicInfo to callers
Date: Fri, 23 Oct 2015 15:13:16 +0200	[thread overview]
Message-ID: <871tclhgnn.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <20151021111620.GC21888@redhat.com> (Daniel P. Berrange's message of "Wed, 21 Oct 2015 12:16:20 +0100")

"Daniel P. Berrange" <berrange@redhat.com> writes:

> On Tue, Oct 20, 2015 at 04:53:24PM -0600, Eric Blake wrote:
>> On 10/20/2015 08:46 AM, Markus Armbruster wrote:
>> > Gerd Hoffmann <kraxel@redhat.com> writes:
>> > 
>> >>   Hi,
>> >>
>> >>>> -static VncBasicInfo *vnc_basic_info_get(struct sockaddr_storage *sa,
>> >>>> -                                        socklen_t salen)
>> >>>> +static void vnc_basic_info_get(struct sockaddr_storage *sa,
>> >>>> +                               socklen_t salen,
>> >>>> +                               VncBasicInfo *info,
>> >>>> +                               Error **errp)
>> >>
>> >>> The function no longer "gets info", it merely initializes it.  Rename it
>> >>> accordingly?  Gerd?
>> >>
>> >> vnc_fill_basic_info maybe?
>> > 
>> > Fine with me.  Could also call it _init_ instead of _fill_.
>> 
>> I like init a bit better than fill.
>> 
>> > 
>> >>> Outside this patch's scope, but since I'm looking at the code already...
>> 
>> I'm guessing that also means that fixing it is outside this series' scope.
>> 
>> >>> When vnc_server_info_get() fails, the event is dropped.  Why is that
>> >>> okay?  Failure seems unlikely, though.
>> >>
>> >> Suggestions what else to do?  I don't wanna crash qemu by calling
>> >> qapi_event_send_vnc_* with a NULL pointer.  And, yes, it should be
>> >> highly unlikely so trying some more sophisticated error handling would
>> >> probably be dead code ...
>> > 
>> > These events signal a state change.  Dropping them make me feel uneasy,
>> > because if a client uses them to track state, it gets out of sync.
>> 
>> Events are already best-effort; clients have to be prepared to miss an
>> event - but that's mainly when reconnecting (such as across libvirtd
>> restarts), and not while the monitor is reliably connected.
>> 
>> > The events need to identify the server to be of any use for state
>> > tracking.  Currently, this is members host, service, family of data
>> > member server.
>> > 
>> > We could avoid failures in vnc_qmp_event() as follows:
>> > 
>> > 1. When we create a server, we obtain its info with getsockname() and
>> >    getnameinfo().  If they fail, we fail server creation.  Else, we
>> >    store the info for vnc_qmp_event().
>> > 
>> > 2. When a client connects, we obtain its info with getpeername() and
>> >    getnameinfo().  If they fail, we refuse the connection.  Else, we
>> >    store the infor for vnc_qmp_event().
>> 
>> Seems reasonable to me, but starts to be out of scope for what I'm
>> currently tackling, so is this something I can hand to you, Gerd?
>
> My pending IO channel patches do exactly this
>
> Take a look at the QIOChannelSocket impl
>
>   https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg03440.html
>
> This caches the results of getpeername & getsockname in the
> QOIChannelSocket object.
>
> So my patches which convert VNC to use QIOChannelSOcket should solve
> this particular failure scenario you're discussing.

Great!  No need to add a FIXME comment then.

  reply	other threads:[~2015-10-23 13:13 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16  4:15 [Qemu-devel] [PATCH v9 00/17] qapi collision reduction (post-introspection subset B') Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 01/17] qapi: Add tests for reserved name abuse Eric Blake
2015-10-19 16:05   ` Markus Armbruster
2015-10-20 16:23     ` Eric Blake
2015-10-21 12:08       ` Markus Armbruster
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 02/17] qapi: Reserve '*List' type names for arrays Eric Blake
2015-10-19 16:14   ` Markus Armbruster
2015-10-20 18:12     ` Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 03/17] qapi: Reserve 'u' and 'has[-_]*' member names Eric Blake
2015-10-19 17:19   ` Markus Armbruster
2015-10-20 21:29     ` Eric Blake
2015-10-21 13:08       ` Markus Armbruster
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 04/17] vnc: hoist allocation of VncBasicInfo to callers Eric Blake
2015-10-20  7:38   ` Markus Armbruster
2015-10-20  8:54     ` Gerd Hoffmann
2015-10-20 14:46       ` Markus Armbruster
2015-10-20 22:53         ` Eric Blake
2015-10-21 11:02           ` Markus Armbruster
2015-10-21 11:16           ` Daniel P. Berrange
2015-10-23 13:13             ` Markus Armbruster [this message]
2015-10-20 22:56     ` Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 05/17] qapi: Unbox base members Eric Blake
2015-10-16 19:12   ` [Qemu-devel] [PATCH v9 05.5/17] fixup to " Eric Blake
2015-10-20 12:09   ` [Qemu-devel] [PATCH v9 05/17] " Markus Armbruster
2015-10-20 16:08     ` Eric Blake
2015-10-21 13:34       ` Markus Armbruster
2015-10-21 21:16         ` Eric Blake
2015-10-22  6:28           ` Markus Armbruster
2015-10-23  1:50         ` Eric Blake
2015-10-23  6:26           ` Markus Armbruster
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 06/17] qapi-visit: Remove redundant functions for flat union base Eric Blake
2015-10-21 17:36   ` Markus Armbruster
2015-10-21 19:01     ` Eric Blake
2015-10-22  8:32       ` Markus Armbruster
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 07/17] qapi: Start converting to new qapi union layout Eric Blake
2015-10-22 13:54   ` Markus Armbruster
2015-10-22 14:09     ` Eric Blake
2015-10-22 14:44       ` Markus Armbruster
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 08/17] tests: Convert " Eric Blake
2015-10-22 14:01   ` Markus Armbruster
2015-10-22 14:22     ` Eric Blake
2015-10-22 14:57       ` Markus Armbruster
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 09/17] block: " Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 10/17] nbd: " Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 11/17] net: " Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 12/17] char: " Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 13/17] input: " Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 14/17] memory: " Eric Blake
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 15/17] tpm: " Eric Blake
2015-10-22 14:19   ` Markus Armbruster
2015-10-22 14:26     ` Eric Blake
2015-10-22 16:40       ` Eric Blake
2015-10-23  6:24         ` Markus Armbruster
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 16/17] qapi: Finish converting " Eric Blake
2015-10-22 14:50   ` Markus Armbruster
2015-10-16  4:15 ` [Qemu-devel] [PATCH v9 17/17] qapi: Simplify gen_struct_field() Eric Blake
2015-10-22 15:13 ` [Qemu-devel] [PATCH v9 00/17] qapi collision reduction (post-introspection subset B') Markus Armbruster

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=871tclhgnn.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.