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

Re: [libvirt] [PATCHv2 5/5] S390: Added sysinfo for host on s390x.



On Fri, Jun 22, 2012 at 01:50:14PM +0200, Viktor Mihajlovski wrote:

> +static int
> +virSysinfoParseProcessor(const char *base, virSysinfoDefPtr ret)
> +{

> +    /* Find processor N: line and gather the processor manufacturer, version, serial number, and family */
> +    while((tmp_base = strstr(base, "processor ")) != NULL) {

Missing space after 'while'


> +/* virSysinfoRead for s390x
> + * Gathers sysinfo data from /proc/sysinfo and /proc/cpuinfo */
> +virSysinfoDefPtr
> +virSysinfoRead(void) {
> +    virSysinfoDefPtr ret = NULL;
> +    char *outbuf = NULL;
> +
> +    if (VIR_ALLOC(ret) < 0)
> +        goto no_memory;
> +
> +    /* Gather info from /proc/cpuinfo */
> +    if(virFileReadAll(CPUINFO, 2048, &outbuf) < 0) {

Missing space after 'if'

> +        virSmbiosReportError(VIR_ERR_INTERNAL_ERROR,
> +                             _("Failed to open %s"), CPUINFO);
> +        return NULL;
> +    }
> +
> +    ret->nprocessor = 0;
> +    ret->processor = NULL;
> +    if (virSysinfoParseProcessor(outbuf, ret) < 0)
> +        goto no_memory;
> +
> +    /* Free buffer before reading next file */
> +    VIR_FREE(outbuf);
> +
> +    /* Gather info from /proc/sysinfo */
> +    if(virFileReadAll(SYSINFO, 4096, &outbuf) < 0) {

Missing space

> +              virSmbiosReportError(VIR_ERR_INTERNAL_ERROR,
> +                                   _("Failed to open %s"), SYSINFO);
> +              return NULL;
> +       }

Messed up indentation.

> +
> +    if (virSysinfoParseSystem(outbuf, ret) < 0)
> +        goto no_memory;
> +
> +    return ret;
> +
> +no_memory:
> +    VIR_FREE(outbuf);
> +    return NULL;
> +}
> +
>  #elif defined(WIN32) || \
>      !(defined(__x86_64__) || \
>        defined(__i386__) ||   \


ACK with the whitespace fixes

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


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