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

To: Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/2] libxl, Introduce the command line handler for the new qemu.
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Date: Thu, 05 Aug 2010 14:25:10 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Delivery-date: Thu, 05 Aug 2010 06:26:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1008041820280.19809@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1280938265-12107-1-git-send-email-anthony.perard@xxxxxxxxxx> <1280938265-12107-2-git-send-email-anthony.perard@xxxxxxxxxx> <alpine.DEB.2.00.1008041820280.19809@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328)
Stefano Stabellini wrote:
On Wed, 4 Aug 2010, anthony.perard@xxxxxxxxxx wrote:
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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

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

<Prev in Thread] Current Thread [Next in Thread>