From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWt1l-0007Cs-RE for qemu-devel@nongnu.org; Wed, 24 Sep 2014 16:19:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWt1c-0007gT-8j for qemu-devel@nongnu.org; Wed, 24 Sep 2014 16:19:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWt1c-0007fy-1D for qemu-devel@nongnu.org; Wed, 24 Sep 2014 16:18:56 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8OKA3vU017404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 24 Sep 2014 16:10:03 -0400 Message-ID: <54232513.4010800@redhat.com> Date: Wed, 24 Sep 2014 22:09:55 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1411587521-3569-1-git-send-email-mreitz@redhat.com> <1411587521-3569-2-git-send-email-mreitz@redhat.com> In-Reply-To: <1411587521-3569-2-git-send-email-mreitz@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] nbd: Fix filename generation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi Il 24/09/2014 21:38, Max Reitz ha scritto: > Export names may be used with nbd+unix, too, fix nbd_refresh_filename() > accordingly. Also, for nbd+tcp, the documented path schema is > "nbd://host[:port]/export", so use it. Furthermore, as can be seen from > that schema, the port is optional. > > That makes six single cases for how the filename can be formatted; it is > not easy to generalize these cases without the resulting statement being > completely unreadable, thus there is simply one snprintf() per case. You could use GString, but I guess it won't be much better... Reviewed-by: Paolo Bonzini