From: "Daniel P. Berrange" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qio_dns_resolver_lookup_sync() and SOCKET_ADDRESS_KIND_FD?
Date: Mon, 3 Apr 2017 12:29:30 +0100 [thread overview]
Message-ID: <20170403112930.GQ2768@redhat.com> (raw)
In-Reply-To: <87var0c5ww.fsf@dusky.pond.sub.org>
On Thu, Mar 23, 2017 at 05:30:07PM +0100, Markus Armbruster wrote:
> Ignorant question: does qio_dns_resolver_lookup_sync() do the right
> thing for SOCKET_ADDRESS_KIND_FD? The switch doesn't have a case for
> it, and it's unclear whether the default case is really meant for
> SOCKET_ADDRESS_KIND_FD in addition to impossible enumeration values.
No, it is wrong - it should do a 'no op' resolution, not return an
error - ie KIND_FD handling should match KIND_UNIX/KIND_VSOCK.
> Aside: impossible value means your program state is fatally
> compromised. I'd rather assert then.
Sure.
>
>
> int qio_dns_resolver_lookup_sync(QIODNSResolver *resolver,
> SocketAddress *addr,
> size_t *naddrs,
> SocketAddress ***addrs,
> Error **errp)
> {
> switch (addr->type) {
> case SOCKET_ADDRESS_KIND_INET:
> return qio_dns_resolver_lookup_sync_inet(resolver,
> addr,
> naddrs,
> addrs,
> errp);
>
> case SOCKET_ADDRESS_KIND_UNIX:
> case SOCKET_ADDRESS_KIND_VSOCK:
> return qio_dns_resolver_lookup_sync_nop(resolver,
> addr,
> naddrs,
> addrs,
> errp);
>
> default:
> error_setg(errp, "Unknown socket address kind");
> return -1;
> }
> }
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
prev parent reply other threads:[~2017-04-03 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 16:30 [Qemu-devel] qio_dns_resolver_lookup_sync() and SOCKET_ADDRESS_KIND_FD? Markus Armbruster
2017-04-03 11:29 ` Daniel P. Berrange [this message]
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=20170403112930.GQ2768@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@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.