From: Gianni Tedesco Subject: Re: [PATCH 1/2] libxl, Introduce the command line handler for the new qemu. Date: Wed, 4 Aug 2010 17:41:35 +0100 Message-ID: <1280940095.18490.212.camel@qabil.uk.xensource.com> References: <1280938265-12107-1-git-send-email-anthony.perard@citrix.com> <1280938265-12107-2-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1280938265-12107-2-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "anthony.perard@citrix.com" Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Wed, 2010-08-04 at 17:11 +0100, anthony.perard@citrix.com 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