[libvirt] [PATCH 1/6] Introduce a set of APIs for managing architectures

Eric Blake eblake at redhat.com
Tue Dec 11 17:36:30 UTC 2012


On 12/11/2012 07:53 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Introduce a 'virArch' enum for CPU architectures. Include
> data type providing wordsize and endianness, and APIs to
> query this info and convert to/from enum and string form.
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
> +/**
> + * virArchFromString:
> + * @archstr: the CPU architecture string
> + *
> + * Return the architecture matching @archstr,
> + * defaulting to VIR_ARCH_I686 if unidentified

Really?

> + */
> +virArch virArchFromString(const char *archstr)
> +{
> +    size_t i;
> +    for (i = 1 ; i < VIR_ARCH_LAST ; i++) {
> +        if (STREQ(virArchData[i].name, archstr))
> +            return i;
> +    }
> +
> +    VIR_DEBUG("Unknown arch %s", archstr);
> +    return VIR_ARCH_NONE;

Looks like you return NONE instead.

Other than the mixed-up comment, looks good to go after 1.0.1.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121211/a6e20b72/attachment-0001.sig>


More information about the libvir-list mailing list