From: Anthony PERARD <anthony.perard@citrix.com>
To: Xen Devel <xen-devel@lists.xen.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH 1/2] libxl: adding support to use -machine option of QEMU.
Date: Fri, 22 Nov 2013 15:13:10 +0000 [thread overview]
Message-ID: <1385133191-23033-2-git-send-email-anthony.perard@citrix.com> (raw)
In-Reply-To: <1385133191-23033-1-git-send-email-anthony.perard@citrix.com>
It adds a new config option, "qemu_machine_override".
This can be used in the future to switch to a Q35 based device model. It
can also be used on a recent QEMU to avoid adding the xen-platform
device used to setup PV drivers in the guest.
Two possible values for now are "pc" or "xenfv" but there are
equivalents and xenfv is the default. A possible future use could be
qemu_machine_override="q35" when this machine will be able to start
successfully on Xen.
When passed to qemu, libxl automatically adds ",accel=xen" to the
machine option.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
tools/libxl/libxl_dm.c | 7 +++++--
tools/libxl/libxl_types.idl | 1 +
tools/libxl/xl_cmdimpl.c | 3 +++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 292e351..3d4a913 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -608,7 +608,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
}
for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
flexarray_append(dm_args, b_info->extra[i]);
- flexarray_append(dm_args, "-M");
+ flexarray_append(dm_args, "-machine");
switch (b_info->type) {
case LIBXL_DOMAIN_TYPE_PV:
flexarray_append(dm_args, "xenpv");
@@ -616,7 +616,10 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
flexarray_append(dm_args, b_info->extra_pv[i]);
break;
case LIBXL_DOMAIN_TYPE_HVM:
- flexarray_append(dm_args, "xenfv");
+ if (b_info->qemu_machine)
+ flexarray_append(dm_args, GCSPRINTF("%s,accel=xen", b_info->qemu_machine));
+ else
+ flexarray_append(dm_args, "xenfv");
for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
flexarray_append(dm_args, b_info->extra_hvm[i]);
break;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index cba8eff..4141501 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -317,6 +317,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
# if you set device_model you must set device_model_version too
("device_model", string),
("device_model_ssidref", uint32),
+ ("qemu_machine", string),
# extra parameters pass directly to qemu, NULL terminated
("extra", libxl_string_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 341863e..4de6858 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1491,6 +1491,9 @@ skip_vfb:
}
+ xlu_cfg_replace_string (config, "qemu_machine_override",
+ &b_info->qemu_machine, 0);
+
xlu_cfg_replace_string (config, "device_model_override",
&b_info->device_model, 0);
if (!xlu_cfg_get_string (config, "device_model_version", &buf, 0)) {
--
Anthony PERARD
next prev parent reply other threads:[~2013-11-22 15:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 15:13 [PATCH 0/2] Handle xen_platform_pci=0 case Anthony PERARD
2013-11-22 15:13 ` Anthony PERARD [this message]
2013-11-29 12:29 ` [PATCH 1/2] libxl: adding support to use -machine option of QEMU Stefano Stabellini
2013-11-22 15:13 ` [PATCH 2/2] libxl: Handle xen_platform_pci=0 case with qemu-xen Anthony PERARD
2013-11-29 12:31 ` Stefano Stabellini
2013-11-29 12:49 ` Fabio Fantoni
[not found] ` <20131122151838.GA10855@perard.uk.xensource.com>
2013-11-22 15:30 ` Processed: Re: [PATCH 0/2] Handle xen_platform_pci=0 case xen
2013-11-22 15:49 ` Fabio Fantoni
2013-11-22 16:54 ` Anthony PERARD
2013-11-25 9:04 ` Fabio Fantoni
2013-11-25 11:11 ` Anthony PERARD
2013-11-29 16:06 ` Fabio Fantoni
2013-11-29 16:20 ` Sander Eikelenboom
2013-11-26 19:08 ` Konrad Rzeszutek Wilk
2013-11-26 20:09 ` Konrad Rzeszutek Wilk
2013-11-28 16:14 ` Anthony PERARD
2013-11-22 15:56 ` Ian Campbell
2013-11-22 17:18 ` Anthony PERARD
2013-11-22 17:23 ` Ian Campbell
2013-11-22 17:31 ` Ian Campbell
2013-11-22 17:40 ` Anthony PERARD
2013-11-22 17:24 ` George Dunlap
2013-11-22 17:06 ` George Dunlap
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=1385133191-23033-2-git-send-email-anthony.perard@citrix.com \
--to=anthony.perard@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=xen-devel@lists.xen.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).