On 06/27/2014 02:24 AM, Chrysostomos Nanakos wrote: > qemu-img archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>] > [:segment=<segment_name>]] [size] > > Signed-off-by: Chrysostomos Nanakos <[email protected]> > --- > 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.
> +
> + 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?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
