From patchwork Fri May 9 16:39:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 347474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 6C7C2140079 for ; Sat, 10 May 2014 02:39:52 +1000 (EST) Received: from localhost ([::1]:53593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Winpu-000227-D7 for incoming@patchwork.ozlabs.org; Fri, 09 May 2014 12:39:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WinpW-0001j2-CD for qemu-devel@nongnu.org; Fri, 09 May 2014 12:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WinpQ-0005lE-8q for qemu-devel@nongnu.org; Fri, 09 May 2014 12:39:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WinpQ-0005l4-0j for qemu-devel@nongnu.org; Fri, 09 May 2014 12:39:20 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s49GdI82028498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 9 May 2014 12:39:18 -0400 Received: from amosk.info.com (vpn1-115-199.nay.redhat.com [10.66.115.199]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s49GdGvX026165; Fri, 9 May 2014 12:39:17 -0400 From: Amos Kong To: qemu-devel@nongnu.org Date: Sat, 10 May 2014 00:39:13 +0800 Message-Id: <1399653553-5978-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: djasa@redhat.com, kraxel@redhat.com Subject: [Qemu-devel] [PATCH] spice: return unspecified address according to protocol X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Commit 4f60af9a changed '0.0.0.0' to '*' to indicate unspecified address. "::" is used to indicate unspecified address in IPV6. This patch returns different address for different protocol, it's more meaningful for the protocol specification than returning '*'. Signed-off-by: Amos Kong --- ui/spice-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index d10818a..929c405 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -533,7 +533,9 @@ SpiceInfo *qmp_query_spice(Error **errp) info->auth = g_strdup(auth); info->has_host = true; - info->host = g_strdup(addr ? addr : "*"); + info->host = g_strdup(addr ? addr : (qemu_opt_get_bool(opts, + "ipv6", 0) + ? "::" : "0.0.0.0")); info->has_compiled_version = true; major = (SPICE_SERVER_VERSION & 0xff0000) >> 16;