From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2LCZ-0008O1-44 for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:08:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2LCS-0000q9-Rb for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:07:59 -0400 Received: from averel.grnet-hq.admin.grnet.gr ([195.251.29.3]:7343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2LCS-0000TL-KM for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:07:52 -0400 Message-ID: <53B411E5.20000@grnet.gr> Date: Wed, 02 Jul 2014 17:06:29 +0300 From: Chrysostomos Nanakos MIME-Version: 1.0 References: <1403857452-23768-1-git-send-email-cnanakos@grnet.gr> <1403857452-23768-4-git-send-email-cnanakos@grnet.gr> <53B410A3.4010507@redhat.com> In-Reply-To: <53B410A3.4010507@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 3/5] block/archipelago: Add support for creating images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com On 07/02/2014 05:01 PM, Eric Blake wrote: > On 06/27/2014 02:24 AM, Chrysostomos Nanakos wrote: >> qemu-img archipelago:[/mport=[:vport=] >> [:segment=]] [size] >> >> Signed-off-by: Chrysostomos Nanakos >> --- >> block/archipelago.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 149 insertions(+) >> >> + >> + /* Try default values if none has been set */ >> + if (mportno == (xport) -1) { >> + mportno = 1001; >> + } >> + >> + if (vportno == (xport) -1) { >> + vportno = 501; >> + } > I've now seen these magic numbers in more than one patch; it's worth a > #define or enum name. Yes for sure. I will use two #define's for that. >> + >> + if (segment_name == NULL) { >> + segment_name = g_strdup("archipelago"); >> + } >> + >> + if (xseg_initialize()) { >> + error_setg(errp, "Cannot initialize XSEG"); >> + return -1; >> + } >> + >> + xseg = xseg_join((char *)"posix", segment_name, >> + (char *)"posixfd", NULL); > Do you really have to cast away const to use this interface? Have you > reported that as a design bug to the authors of xseg_join? I will remove casting and fix xseg_join. Thanks.