Re: [libvirt] [PATCH] create() and destroy() support for Power Hypervisor

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

 



On Tue, Nov 03, 2009 at 03:49:16PM -0200, Eduardo Otubo wrote:
> New patch, more fixes.
>
> Matthias Bolte wrote:

> +    for (i = 0; i < uuid_table->nlpars; i++) {
> +        if (write
> +            (fd, &uuid_table->lpars[i]->id,
> +             sizeof(uuid_table->lpars[i]->id)) ==
> +            sizeof(uuid_table->lpars[i]->id)) {

  should use safewrite() and the comparison should be != instead of ==
Did you really test this part of the code ?

> +            VIR_ERROR("%s", "Unable to write information to local file.");
> +            goto err;
> +        }
> +
> +        if (write(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN) ==
> +            VIR_UUID_BUFLEN) {

  same mistake

> +            VIR_ERROR("%s", "Unable to write information to local file.");
> +            goto err;
> +        }
> +    }
[...]
> +            rc = libssh2_channel_read(channel, buffer, amount);
> +            if (rc > 0) {
> +                if (write(fd, buffer, rc) == -1)
> +                    VIR_WARN("%s",
> +                             "Unable to write information to local file.");

  and another one.

So I cleaned up those and commited the patch, that doesn't prevent
fixing more things but at least taht wil come in small patches,

  thanks !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]