From: Laurent Vivier <lvivier@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Eric Blake" <eblake@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>
Subject: [PATCH v6 12/13] qemu-sockets: update socket_uri() to be consistent with socket_parse()
Date: Wed, 6 Jul 2022 08:46:07 +0200 [thread overview]
Message-ID: <20220706064607.1397659-1-lvivier@redhat.com> (raw)
In-Reply-To: <20220706062847.1396719-1-lvivier@redhat.com>
Remove 'tcp:' prefix for inet type (because inet can be 'tcp' or 'udp'
and socket_parse() doesn't recognize it), the format is 'host:port'.
Use 'vsock:' prefix for vsock type rather than 'tcp:' because it makes
a vsock address look like an inet address with CID misinterpreted as host.
Goes back to commit 9aca82ba31 "migration: Create socket-address parameter"
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
util/qemu-sockets.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 870a36eb0e93..4cd76b3ae3af 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -1102,7 +1102,7 @@ char *socket_uri(SocketAddress *addr)
{
switch (addr->type) {
case SOCKET_ADDRESS_TYPE_INET:
- return g_strdup_printf("tcp:%s:%s",
+ return g_strdup_printf("%s:%s",
addr->u.inet.host,
addr->u.inet.port);
case SOCKET_ADDRESS_TYPE_UNIX:
@@ -1111,7 +1111,7 @@ char *socket_uri(SocketAddress *addr)
case SOCKET_ADDRESS_TYPE_FD:
return g_strdup_printf("fd:%s", addr->u.fd.str);
case SOCKET_ADDRESS_TYPE_VSOCK:
- return g_strdup_printf("tcp:%s:%s",
+ return g_strdup_printf("vsock:%s:%s",
addr->u.vsock.cid,
addr->u.vsock.port);
default:
--
2.36.1
next prev parent reply other threads:[~2022-07-06 6:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 6:28 [PATCH v6 00/13] qapi: net: add unix socket type support to netdev backend Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 01/13] net: introduce convert_host_port() Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 02/13] net: remove the @errp argument of net_client_inits() Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 03/13] net: simplify net_client_parse() error management Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 04/13] qapi: net: introduce a way to bypass qemu_opts_parse_noisily() Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 05/13] qapi: net: add stream and dgram netdevs Laurent Vivier
2022-07-06 14:23 ` Markus Armbruster
2022-07-06 6:28 ` [PATCH v6 06/13] net: stream: Don't ignore EINVAL on netdev socket connection Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 07/13] net: stream: add unix socket Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 08/13] net: dgram: make dgram_dst generic Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 09/13] net: dgram: move mcast specific code from net_socket_fd_init_dgram() Laurent Vivier
2022-07-06 6:28 ` [PATCH v6 10/13] net: dgram: add unix socket Laurent Vivier
2022-07-06 6:46 ` Laurent Vivier [this message]
2022-07-12 12:05 ` [PATCH v6 12/13] qemu-sockets: update socket_uri() to be consistent with socket_parse() Dr. David Alan Gilbert
2022-07-13 16:46 ` Laurent Vivier
2022-07-13 17:26 ` Daniel P. Berrangé
2022-07-06 6:46 ` [PATCH v6 13/13] net: stream: move to QIO Laurent Vivier
2022-07-06 6:53 ` [PATCH v6 11/13] qemu-sockets: move and rename SocketAddress_to_str() Laurent Vivier
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=20220706064607.1397659-1-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=jasowang@redhat.com \
--cc=pbonzini@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 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).