From patchwork Thu Mar 16 09:21:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 9627741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB22C60244 for ; Thu, 16 Mar 2017 09:28:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4C6C28530 for ; Thu, 16 Mar 2017 09:28:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B848928672; Thu, 16 Mar 2017 09:28:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5290828530 for ; Thu, 16 Mar 2017 09:28:40 +0000 (UTC) Received: from localhost ([::1]:41825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coRi3-00022l-EF for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Mar 2017 05:28:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coRbz-0004f3-DT for qemu-devel@nongnu.org; Thu, 16 Mar 2017 05:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coRby-0000XQ-BJ for qemu-devel@nongnu.org; Thu, 16 Mar 2017 05:22:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37558) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1coRby-0000Wx-5u for qemu-devel@nongnu.org; Thu, 16 Mar 2017 05:22:22 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BAC881253 for ; Thu, 16 Mar 2017 09:22:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3BAC881253 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3BAC881253 Received: from localhost (ovpn-117-78.phx2.redhat.com [10.3.117.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DA11627D9; Thu, 16 Mar 2017 09:22:21 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 16 Mar 2017 13:21:13 +0400 Message-Id: <20170316092121.25672-14-marcandre.lureau@redhat.com> In-Reply-To: <20170316092121.25672-1-marcandre.lureau@redhat.com> References: <20170316092121.25672-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 16 Mar 2017 09:22:22 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 13/21] char-socket: add 'addr' property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a property to lookup the connection details. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- chardev/char-socket.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 4325a05387..81021c5863 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1006,6 +1006,15 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, sock->addr = addr; } +static void +char_socket_get_addr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + SocketChardev *s = SOCKET_CHARDEV(obj); + + visit_type_SocketAddress(v, name, &s->addr, errp); +} + static void char_socket_class_init(ObjectClass *oc, void *data) { ChardevClass *cc = CHARDEV_CLASS(oc); @@ -1021,6 +1030,10 @@ static void char_socket_class_init(ObjectClass *oc, void *data) cc->chr_add_client = tcp_chr_add_client; cc->chr_add_watch = tcp_chr_add_watch; cc->chr_update_read_handler = tcp_chr_update_read_handler; + + object_class_property_add(oc, "addr", "SocketAddress", + char_socket_get_addr, NULL, + NULL, NULL, &error_abort); } static const TypeInfo char_socket_type_info = {