WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 1/2] libxl, Introduce the command line handler fo

On Wed, 2010-08-04 at 17:11 +0100, anthony.perard@xxxxxxxxxx wrote:
> +    // Search for the new version or the old version:
> +    // QEMU emulator version 0.12.50, ...
> +    // QEMU PC emulator version 0.10.2, ...
> +    if (strncmp("QEMU", buf, 4) == 0) {
> +        char *v = strstr(buf, "version ");
> +        if (v) {
> +            int major, minor;
> +            char *endptr = NULL;
> +
> +            v += strlen("version ");
> +            major = strtol(v, &endptr, 10);
> +            if (major == 0 && endptr && *endptr == '.') {
> +                v = endptr + 1;
> +                minor = strtol(v, &endptr, 10);
> +                if (minor >= 12)
> +                    return 1;
> +            }
> +            return 0;
> +        }
> +    }
> +    return 0;
> +}

I don't like it. The version number is not a clear indication of
parameters especially of patched versions. If you are going to do
anything like this then qemu-dm ought to print out QEMU-DM and handle it
like that.

As for mainstream qemu, I hear that a future version will contain some
capability querying functionality.

Gianni


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel