From: Anthony PERARD <anthony.perard@citrix.com>
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Gianni Tedesco <gianni.tedesco@citrix.com>
Subject: Re: [PATCH 1/2] libxl, Introduce the command line handler for the new qemu.
Date: Thu, 05 Aug 2010 14:25:10 +0100 [thread overview]
Message-ID: <4C5ABBB6.6070608@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1008041820280.19809@kaball-desktop>
Stefano Stabellini wrote:
> On Wed, 4 Aug 2010, anthony.perard@citrix.com wrote:
>> From: Anthony PERARD <anthony.perard@citrix.com>
>>
>> This patch adds a function to check the version of the device model.
>> Depending on the version of the DM, the command line arguments will be
>> built differently.
>>
>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>> ---
>> tools/libxl/libxl.c | 163 ++++++++++++++++++++++++++++++++++++++++++++-
>> tools/libxl/libxl_utils.c | 73 ++++++++++++++++++++
>> tools/libxl/libxl_utils.h | 5 ++
>> 3 files changed, 240 insertions(+), 1 deletions(-)
>>
>> [...]
>>
>> + // 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 think Gianni is right about the string to search: it is probably
> better to add a Xen specific string to qemu-dm, like "QEMU-DM", and rely
> on that and the version (0.10.2 or older) to distinguish between the
> two.
I can do something better by run "qemu -M ?" and check if "xenfv"
machine is supported. This work with both versions.
--
Anthony PERARD
next prev parent reply other threads:[~2010-08-05 13:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-04 16:11 [PATCH 0/2] libxl, Handle the command line options of qemu 0.12 anthony.perard
2010-08-04 16:11 ` [PATCH 1/2] libxl, Introduce the command line handler for the new qemu anthony.perard
2010-08-04 16:41 ` Gianni Tedesco
2010-08-04 17:24 ` Stefano Stabellini
2010-08-05 13:25 ` Anthony PERARD [this message]
2010-08-05 14:40 ` Gianni Tedesco
2010-08-05 16:45 ` Stefano Stabellini
2010-08-05 16:48 ` Gianni Tedesco
2010-08-05 18:03 ` [PATCH] Change the first line of help to add 'QEMU-DM' anthony.perard
2010-08-05 18:03 ` [PATCH v2 1/2] tools/hotplug, Use udev rules instead of qemu script to setup the bridge anthony.perard
2010-08-05 18:06 ` Anthony PERARD
2010-08-05 18:05 ` [PATCH v2 1/2] libxl, Introduce the command line handler for the new qemu anthony.perard
2010-08-04 16:11 ` [PATCH 2/2] tools/hotplug, Use udev rules instead of qemu script to setup the bridge anthony.perard
2010-08-04 17:44 ` Stefano Stabellini
2010-08-06 15:49 ` Anthony PERARD
2010-08-10 10:52 ` Ian Campbell
2010-08-06 17:23 ` [PATCH v2 0/3] libxl, Handle the command line options of qemu 0.12 anthony.perard
2010-08-06 17:23 ` [PATCH v2 1/3] libxl, Fix name of tap device anthony.perard
2010-08-06 17:23 ` [PATCH v2 2/3] libxl, Introduce the command line handler for the new qemu anthony.perard
2010-08-06 17:23 ` [PATCH v2 3/3] tools/hotplug, Use udev rules instead of qemu script to setup the bridge anthony.perard
2010-08-09 15:40 ` [PATCH v2 0/3] libxl, Handle the command line options of qemu 0.12 Stefano Stabellini
2010-08-10 15:20 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C5ABBB6.6070608@citrix.com \
--to=anthony.perard@citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=gianni.tedesco@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.