qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 3/5] block/archipelago: Add support for creat


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v6 3/5] block/archipelago: Add support for creating images
Date: Wed, 02 Jul 2014 08:01:07 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

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 <address@hidden>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]