Message ID | 1407517649-11257-3-git-send-email-peter.maydell@linaro.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <patchwork-forward+bncBC6Z756YVMIBB7MISSPQKGQEL7ZQQAQ@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5AB0D2118A for <linaro@patches.linaro.org>; Fri, 8 Aug 2014 17:10:21 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ij19sf16427972vcb.0 for <linaro@patches.linaro.org>; Fri, 08 Aug 2014 10:10:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=bhhi8jSp6kfRlZs9N51haSKCD4gQ19D0BN64Mo9Zr+A=; b=WsP2/KRkkYc6BRFlkUMR+tN4y0wnDallLSEVlXUZqaEoBYNDnvPLHVL2a51vcB41YG OioE462SPi0H4cqLA8REVAA8vOe/o/BLLJvLYxzjjKUupfF+KsDn7dtdN7RCKs9xF3tw 6YC1TNxeBILEPKP464ftTiJbsER4D5Sr5HhYdXO625SGDn121AP70CfikBhQ4jcwBBBB 24ZEqAQ8DeqsZ4wbHRbJZ/cJKyzb5fBGlEe4s9RZMoHflHBEZ2GJsv1D0lxBLZbuuZrK tE07EDeaWVWKNlEq/7J7oKnEzCiWzldEFs+guJlIDo9pn35XsK8KBX620lxxeF3q2yAE V/tg== X-Gm-Message-State: ALoCoQl2Khrv8w0L3l9i7Ah4Y3Nz1yOpzgQ/BmSVmu7Brp9nsweTK+iRvO+fxP1aLcaMNTXJmWtN X-Received: by 10.52.11.133 with SMTP id q5mr867931vdb.4.1407517821107; Fri, 08 Aug 2014 10:10:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.35 with SMTP id n32ls613755qge.11.gmail; Fri, 08 Aug 2014 10:10:21 -0700 (PDT) X-Received: by 10.220.144.147 with SMTP id z19mr22822605vcu.26.1407517821000; Fri, 08 Aug 2014 10:10:21 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id y7si3088579vcp.89.2014.08.08.10.10.20 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Aug 2014 10:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so8662172vcb.2 for <patchwork-forward@linaro.org>; Fri, 08 Aug 2014 10:10:20 -0700 (PDT) X-Received: by 10.220.166.9 with SMTP id k9mr23009015vcy.20.1407517820942; Fri, 08 Aug 2014 10:10:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp140036vcb; Fri, 8 Aug 2014 10:10:20 -0700 (PDT) X-Received: by 10.229.97.67 with SMTP id k3mr39183543qcn.1.1407517820477; Fri, 08 Aug 2014 10:10:20 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id gs9si11051503qcb.21.2014.08.08.10.10.20 for <patch@linaro.org> (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 08 Aug 2014 10:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:52054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1XFngK-00055d-0g for patch@linaro.org; Fri, 08 Aug 2014 13:10:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pm215@archaic.org.uk>) id 1XFnfa-0004WT-0A for qemu-devel@nongnu.org; Fri, 08 Aug 2014 13:09:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <pm215@archaic.org.uk>) id 1XFnfY-0004PG-Rm for qemu-devel@nongnu.org; Fri, 08 Aug 2014 13:09:33 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pm215@archaic.org.uk>) id 1XFnfY-0004P9-LN for qemu-devel@nongnu.org; Fri, 08 Aug 2014 13:09:32 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from <pm215@archaic.org.uk>) id 1XFndZ-0002w9-IL; Fri, 08 Aug 2014 18:07:29 +0100 From: Peter Maydell <peter.maydell@linaro.org> To: qemu-devel@nongnu.org Date: Fri, 8 Aug 2014 18:07:27 +0100 Message-Id: <1407517649-11257-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1407517649-11257-1-git-send-email-peter.maydell@linaro.org> References: <1407517649-11257-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Markus Armbruster <armbru@redhat.com> Subject: [Qemu-devel] [PATCH 2/4] util/qemu-sockets.c: Support specifying IPv4 or IPv6 in socket_dgram() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: <patchwork-forward.linaro.org> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 |
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 74cf078..25e5fd1 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -966,8 +966,7 @@ int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp) opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort); switch (remote->kind) { case SOCKET_ADDRESS_KIND_INET: - qemu_opt_set(opts, "host", remote->inet->host); - qemu_opt_set(opts, "port", remote->inet->port); + inet_addr_to_opts(opts, remote->inet); if (local) { qemu_opt_set(opts, "localaddr", local->inet->host); qemu_opt_set(opts, "localport", local->inet->port);
Currently you can specify whether you want a UDP chardev backend to be IPv4 or IPv6 using the ipv4 or ipv6 options if you use the QemuOpts parsing code in inet_dgram_opts(). However the QMP struct parsing code in socket_dgram() doesn't provide this flexibility (which in turn prevents us from converting the UDP backend handling to the new style QAPI framework). Use the existing inet_addr_to_opts() function to convert the remote->inet address to option strings; this handles ipv4 and ipv6 flags as well as host and port. (It will also convert any 'to' specification, which is harmless as it is ignored in this context.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- util/qemu-sockets.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)