From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PULL 03/15] char: Fix socket with "type": "vsock" address
Date: Mon, 3 Apr 2017 17:33:43 +0200 [thread overview]
Message-ID: <20170403153355.19722-4-mreitz@redhat.com> (raw)
In-Reply-To: <20170403153355.19722-1-mreitz@redhat.com>
From: Markus Armbruster <armbru@redhat.com>
Watch this:
$ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "chardev-add", "arguments": { "id": "chr0", "backend": { "type": "socket", "data": { "addr": { "type": "vsock", "data": { "cid": "CID", "port": "P" }}}}}}
Aborted (core dumped)
Crashes because SocketAddress_to_str() is blissfully unaware of
SOCKET_ADDRESS_KIND_VSOCK. Fix that. Pick the output format to match
socket_parse(), just like the existing formats.
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1490895797-29094-3-git-send-email-armbru@redhat.com
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
chardev/char-socket.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 6344b07822..36ab0d633a 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -357,6 +357,10 @@ static char *SocketAddress_to_str(const char *prefix, SocketAddress *addr,
return g_strdup_printf("%sfd:%s%s", prefix, addr->u.fd.data->str,
is_listen ? ",server" : "");
break;
+ case SOCKET_ADDRESS_KIND_VSOCK:
+ return g_strdup_printf("%svsock:%s:%s", prefix,
+ addr->u.vsock.data->cid,
+ addr->u.vsock.data->port);
default:
abort();
}
--
2.12.1
next prev parent reply other threads:[~2017-04-03 15:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 15:33 [Qemu-devel] [PULL 00/15] Block patches for rc3 Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 01/15] block: add missed aio_context_acquire into release_drive Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 02/15] nbd sockets vnc: Mark problematic address family tests TODO Max Reitz
2017-04-03 15:33 ` Max Reitz [this message]
2017-04-03 15:33 ` [Qemu-devel] [PULL 04/15] io vnc sockets: Clean up SocketAddressKind switches Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 05/15] block: Document -drive problematic code and bugs Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 06/15] gluster: Prepare for SocketAddressFlat extension Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 07/15] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd' Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 08/15] sockets: New helper socket_address_crumple() Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 09/15] nbd: Tidy up blockdev-add interface Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 10/15] sheepdog: Fix blockdev-add Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 11/15] qemu-io-cmds: Assert that global and nofile commands don't use ct->perms Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 12/15] iotests: fix 097 when run with qcow Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 13/15] qcow2: Discard unaligned tail when wiping image Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 14/15] iotests: Improve image-clear tests on non-aligned image Max Reitz
2017-04-03 15:33 ` [Qemu-devel] [PULL 15/15] block/parallels: Avoid overflows Max Reitz
2017-04-03 16:48 ` [Qemu-devel] [PULL 00/15] Block patches for rc3 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=20170403153355.19722-4-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.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).