From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2L65-0008M0-HU for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:01:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2L60-0006MJ-5y for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:01:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2L5z-0006M6-T3 for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:01:12 -0400 Message-ID: <53B410A3.4010507@redhat.com> Date: Wed, 02 Jul 2014 08:01:07 -0600 From: Eric Blake MIME-Version: 1.0 References: <1403857452-23768-1-git-send-email-cnanakos@grnet.gr> <1403857452-23768-4-git-send-email-cnanakos@grnet.gr> In-Reply-To: <1403857452-23768-4-git-send-email-cnanakos@grnet.gr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mTnbnNS16UFhWMNlDSCBQJ8aiJ3WEarRx" 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: Chrysostomos Nanakos , qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mTnbnNS16UFhWMNlDSCBQJ8aiJ3WEarRx Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/27/2014 02:24 AM, Chrysostomos Nanakos wrote: > qemu-img archipelago:[/mport=3D[:vport=3D] > [:segment=3D]] [size] >=20 > Signed-off-by: Chrysostomos Nanakos > --- > block/archipelago.c | 149 +++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 149 insertions(+) >=20 > + > + /* Try default values if none has been set */ > + if (mportno =3D=3D (xport) -1) { > + mportno =3D 1001; > + } > + > + if (vportno =3D=3D (xport) -1) { > + vportno =3D 501; > + } I've now seen these magic numbers in more than one patch; it's worth a #define or enum name. > + > + if (segment_name =3D=3D NULL) { > + segment_name =3D g_strdup("archipelago"); > + } > + > + if (xseg_initialize()) { > + error_setg(errp, "Cannot initialize XSEG"); > + return -1; > + } > + > + xseg =3D 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? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mTnbnNS16UFhWMNlDSCBQJ8aiJ3WEarRx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTtBCjAAoJEKeha0olJ0NqpMMIAI+qVIbAzfl98djIPOeWtfPf JRxvowjPUTQYSEfVozxZLJ5Ut7Tuk2W7CXD+nOx0uzV71XZGibc0QryZQGXtw46q pb03CsrkuqezgOJ2vHouIeO/Ag4wRR9ZSsQE1Yhj5Uqh8+WvlqYE7kgLGGrPwF3f CGWBcbKpT5JWTACTponb7gCUUJxWtW6hZNMjBqaGtEnJKb5gG+RtOlchToL1c9e1 x5pndnnPIlMGHebKjq9QhpvnFdH0BWUqFERpvFUGZwGh3AQnadVlwMUHah6CJa6h zzq+UtXg6xdEuLxmO9ZLJuAoikHQ4OJal9mD2kWK7+ho/wkxtc0kC9rX9E42ZZQ= =0rib -----END PGP SIGNATURE----- --mTnbnNS16UFhWMNlDSCBQJ8aiJ3WEarRx--