From: Paolo Bonzini <pbonzini@redhat.com>
To: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: berrange@redhat.com, kraxel@redhat.com, armbru@redhat.com,
"qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] util/qemu-sockets: Drop unused helper socket_address_to_string()
Date: Thu, 8 Jun 2017 15:05:38 +0200 [thread overview]
Message-ID: <faabf6b3-f7e3-fa2c-8adb-b1914dbe8f8a@redhat.com> (raw)
In-Reply-To: <20170608031124.8031-1-maozy.fnst@cn.fujitsu.com>
Cc: qemu-trivial@nongnu.org
On 08/06/2017 05:11, Mao Zhongyi wrote:
> Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
> ---
> include/qemu/sockets.h | 15 ---------------
> util/qemu-sockets.c | 34 ----------------------------------
> 2 files changed, 49 deletions(-)
>
> diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
> index 7abffc4..8eb0172 100644
> --- a/include/qemu/sockets.h
> +++ b/include/qemu/sockets.h
> @@ -106,21 +106,6 @@ SocketAddress *socket_local_address(int fd, Error **errp);
> SocketAddress *socket_remote_address(int fd, Error **errp);
>
> /**
> - * socket_address_to_string:
> - * @addr: the socket address struct
> - * @errp: pointer to uninitialized error object
> - *
> - * Get the string representation of the socket
> - * address. A pointer to the char array containing
> - * string format will be returned, the caller is
> - * required to release the returned value when no
> - * longer required with g_free.
> - *
> - * Returns: the socket address in string format, or NULL on error
> - */
> -char *socket_address_to_string(struct SocketAddress *addr, Error **errp);
> -
> -/**
> * socket_address_flatten:
> * @addr: the socket address to flatten
> *
> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
> index b39ae74..08b1a26 100644
> --- a/util/qemu-sockets.c
> +++ b/util/qemu-sockets.c
> @@ -1301,40 +1301,6 @@ SocketAddress *socket_remote_address(int fd, Error **errp)
> return socket_sockaddr_to_address(&ss, sslen, errp);
> }
>
> -char *socket_address_to_string(struct SocketAddress *addr, Error **errp)
> -{
> - char *buf;
> - InetSocketAddress *inet;
> -
> - switch (addr->type) {
> - case SOCKET_ADDRESS_TYPE_INET:
> - inet = &addr->u.inet;
> - if (strchr(inet->host, ':') == NULL) {
> - buf = g_strdup_printf("%s:%s", inet->host, inet->port);
> - } else {
> - buf = g_strdup_printf("[%s]:%s", inet->host, inet->port);
> - }
> - break;
> -
> - case SOCKET_ADDRESS_TYPE_UNIX:
> - buf = g_strdup(addr->u.q_unix.path);
> - break;
> -
> - case SOCKET_ADDRESS_TYPE_FD:
> - buf = g_strdup(addr->u.fd.str);
> - break;
> -
> - case SOCKET_ADDRESS_TYPE_VSOCK:
> - buf = g_strdup_printf("%s:%s",
> - addr->u.vsock.cid,
> - addr->u.vsock.port);
> - break;
> -
> - default:
> - abort();
> - }
> - return buf;
> -}
>
> SocketAddress *socket_address_flatten(SocketAddressLegacy *addr_legacy)
> {
>
next prev parent reply other threads:[~2017-06-08 13:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 3:11 [Qemu-devel] [PATCH] util/qemu-sockets: Drop unused helper socket_address_to_string() Mao Zhongyi
2017-06-08 6:17 ` Markus Armbruster
2017-06-08 13:05 ` Paolo Bonzini [this message]
2017-06-27 12:58 ` Michael Tokarev
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=faabf6b3-f7e3-fa2c-8adb-b1914dbe8f8a@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=maozy.fnst@cn.fujitsu.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).