qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
	Anthony Liguori <aliguori@amazon.com>,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH v2 3/5] qemu-char: Convert udp backend to QAPI
Date: Tue, 02 Sep 2014 14:04:02 -0600	[thread overview]
Message-ID: <540622B2.1030808@redhat.com> (raw)
In-Reply-To: <1409653457-27863-4-git-send-email-peter.maydell@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

On 09/02/2014 04:24 AM, Peter Maydell wrote:
> Convert the udp char backend to the new style QAPI framework.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  qemu-char.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------------
>  1 file changed, 54 insertions(+), 15 deletions(-)
> 

> +
> +    if (host == NULL || strlen(host) == 0) {
> +        host = "localhost";
> +    }
> +    if (port == NULL || strlen(port) == 0) {
> +        error_setg(errp, "chardev: udp: remote port not specified");

In the common case of these strings being non-empty, you end up having
to hunt for the end of the string only to then throw that information
away.  Rather than 'strlen(foo) == 0)', it's slightly faster to check
'*foo' for being a non-NUL byte.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-09-02 20:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 10:24 [Qemu-devel] [PATCH v2 0/5] Convert remaining legacy chardevs to QAPI Peter Maydell
2014-09-02 10:24 ` [Qemu-devel] [PATCH v2 1/5] qemu-char: Convert socket backend " Peter Maydell
2014-09-02 10:24 ` [Qemu-devel] [PATCH v2 2/5] util/qemu-sockets.c: Support specifying IPv4 or IPv6 in socket_dgram() Peter Maydell
2014-09-02 10:24 ` [Qemu-devel] [PATCH v2 3/5] qemu-char: Convert udp backend to QAPI Peter Maydell
2014-09-02 20:04   ` Eric Blake [this message]
2014-09-02 20:30     ` Peter Maydell
2014-09-02 10:24 ` [Qemu-devel] [PATCH v2 4/5] qemu-char: Remove register_char_driver() machinery Peter Maydell
2014-09-02 10:24 ` [Qemu-devel] [PATCH v2 5/5] qemu-char: Rename register_char_driver_qapi() to register_char_driver() Peter Maydell
2014-09-09  6:47 ` [Qemu-devel] [PATCH v2 0/5] Convert remaining legacy chardevs to QAPI Paolo Bonzini
2014-09-09  8:11   ` Peter Maydell
2014-09-16 23:43     ` Peter Maydell

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=540622B2.1030808@redhat.com \
    --to=eblake@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --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).