From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NVkl1-0005LK-FP for qemu-devel@nongnu.org; Fri, 15 Jan 2010 06:54:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NVkkw-0005E9-LY for qemu-devel@nongnu.org; Fri, 15 Jan 2010 06:54:26 -0500 Received: from [199.232.76.173] (port=40456 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVkkw-0005Dz-F8 for qemu-devel@nongnu.org; Fri, 15 Jan 2010 06:54:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54475) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NVkkv-0001jI-R9 for qemu-devel@nongnu.org; Fri, 15 Jan 2010 06:54:22 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0FBsKJH019419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Jan 2010 06:54:21 -0500 Date: Fri, 15 Jan 2010 09:54:13 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] [PATCH 4/8] VNC: Add 'family' key Message-ID: <20100115095413.600cd858@doriath> In-Reply-To: <4B501F50.3080802@redhat.com> References: <1263487859-6318-1-git-send-email-lcapitulino@redhat.com> <1263487859-6318-5-git-send-email-lcapitulino@redhat.com> <4B501F50.3080802@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org, armbru@redhat.com On Fri, 15 Jan 2010 08:54:56 +0100 Gerd Hoffmann wrote: > > +static QString *get_sock_family(const struct sockaddr_storage *sa) > > +{ > > + const char *name; > > + > > + switch (sa->ss_family) > > + { > > + case AF_INET: > > + name = "ipv4"; > > + break; > > + case AF_INET6: > > + name = "ipv6"; > > + break; > > + default: > > + name = "unknown"; > > + break; > > + } > > + > > + return qstring_from_str(name); > > +} > > qemu-socket has inet_strfamily() already. You might want to un-static > that one, then simply do > > return qstring_from_str(inet_strfamily(sa->ss_family)); Will do and resend. Thanks Gerd.