[libvirt] PATCH 2/4: implement getVersion method for openvz

Daniel Veillard veillard at redhat.com
Mon Oct 20 09:33:20 UTC 2008

On Tue, Oct 14, 2008 at 04:19:06PM +0100, Daniel P. Berrange wrote:
> This patch implements the getVersion driver method for openvz to report
> the version number of vzctl. This is needed in the next patch to determine
> if we have builtin support for bridges

  Looks fine except:

> +static int
> +openvzExtractVersionInfo(const char *cmd, int *retversion)
> +{
> +    enum { MAX_HELP_OUTPUT_SIZE = 8192 };
> +    int len = virFileReadLimFD(newstdout, MAX_HELP_OUTPUT_SIZE, &help);

  Except that part which puzzles me. Why defining an enum for that. Also
enum is one of the worse part of C, it has no clear storage size
definition,  and virFileReadLimFD takes an input int anyway...


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

More information about the libvir-list mailing list