From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NVh1R-0007nw-GB for qemu-devel@nongnu.org; Fri, 15 Jan 2010 02:55:09 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NVh1L-0007my-W5 for qemu-devel@nongnu.org; Fri, 15 Jan 2010 02:55:08 -0500 Received: from [199.232.76.173] (port=39488 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVh1L-0007mv-QV for qemu-devel@nongnu.org; Fri, 15 Jan 2010 02:55:03 -0500 Received: from mx20.gnu.org ([199.232.41.8]:2985) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NVh1L-0005MY-Ay for qemu-devel@nongnu.org; Fri, 15 Jan 2010 02:55:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NVh1K-0002GL-L8 for qemu-devel@nongnu.org; Fri, 15 Jan 2010 02:55:02 -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 o0F7t11P020262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Jan 2010 02:55:01 -0500 Message-ID: <4B501F50.3080802@redhat.com> Date: Fri, 15 Jan 2010 08:54:56 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 4/8] VNC: Add 'family' key References: <1263487859-6318-1-git-send-email-lcapitulino@redhat.com> <1263487859-6318-5-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1263487859-6318-5-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel@nongnu.org, armbru@redhat.com > +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)); cheers, Gerd