* [PATCH] Fix default accelerator when building with --disable-kvm
@ 2012-07-06 15:41 Daniel P. Berrange
2012-07-06 15:58 ` Jan Kiszka
0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2012-07-06 15:41 UTC (permalink / raw)
To: kvm
Cc: Jan Kiszka, Avi Kivity, Marcelo Tosatti, Richard W.M. Jones,
Serge Hallyn, Daniel P. Berrange
From: "Daniel P. Berrange" <berrange@redhat.com>
The following commit
commit 3ad763fcba5bd0ec5a79d4a9b6baeef119dd4a3d
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date: Fri Mar 2 10:30:43 2012 +0100
qemu-kvm: Use machine options to configure qemu-kvm defaults
Upstream is moving towards this mechanism, so start using it in qemu-kvm
already to configure the specific defaults: kvm enabled on, just like
in-kernel irqchips.
prevents qemu from starting when it has been build with the
--disable-kvm argument, because the accelerator is hardcoded
to 'kvm'. This is a regression previously fixed by
commit ce967f6610dcd7b7762dbad5a639fecf42d5c76d
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Fri Aug 5 09:50:29 2011 +0100
Fix default accelerator when configured with --disable-kvm
The default accelerator is hardcoded to 'kvm'. This is a fine
default for qemu-kvm normally, but if the user built with
./configure --disable-kvm, then the resulting binaries will
not work by default
The fix is again to make this conditional on CONFIG_KVM_OPTIONS
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
hw/pc_piix.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 98a06fa..35202dd 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -360,7 +360,9 @@ static QEMUMachine pc_machine_v1_2 = {
.init = pc_init_pci,
.max_cpus = 255,
.is_default = 1,
+#ifdef CONFIG_KVM_OPTIONS
.default_machine_opts = "accel=kvm,kernel_irqchip=on",
+#endif
};
#define PC_COMPAT_1_1 \
@@ -469,7 +471,9 @@ static QEMUMachine pc_machine_v0_14 = {
.desc = "Standard PC",
.init = pc_init_pci,
.max_cpus = 255,
+#ifdef CONFIG_KVM_OPTIONS
.default_machine_opts = "accel=kvm,kernel_irqchip=on",
+#endif
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_14,
{
@@ -503,7 +507,9 @@ static QEMUMachine pc_machine_v0_13 = {
.desc = "Standard PC",
.init = pc_init_pci_no_kvmclock,
.max_cpus = 255,
+#ifdef CONFIG_KVM_OPTIONS
.default_machine_opts = "accel=kvm,kernel_irqchip=on",
+#endif
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_13,
{
@@ -541,7 +547,9 @@ static QEMUMachine pc_machine_v0_12 = {
.desc = "Standard PC",
.init = pc_init_pci_no_kvmclock,
.max_cpus = 255,
+#ifdef CONFIG_KVM_OPTIONS
.default_machine_opts = "accel=kvm,kernel_irqchip=on",
+#endif
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_12,
{
@@ -575,7 +583,9 @@ static QEMUMachine pc_machine_v0_11 = {
.desc = "Standard PC, qemu 0.11",
.init = pc_init_pci_no_kvmclock,
.max_cpus = 255,
+#ifdef CONFIG_KVM_OPTIONS
.default_machine_opts = "accel=kvm,kernel_irqchip=on",
+#endif
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_11,
{
@@ -597,7 +607,9 @@ static QEMUMachine pc_machine_v0_10 = {
.desc = "Standard PC, qemu 0.10",
.init = pc_init_pci_no_kvmclock,
.max_cpus = 255,
+#ifdef CONFIG_KVM_OPTIONS
.default_machine_opts = "accel=kvm,kernel_irqchip=on",
+#endif
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_11,
{
@@ -631,7 +643,9 @@ static QEMUMachine isapc_machine = {
.desc = "ISA-only PC",
.init = pc_init_isa,
.max_cpus = 1,
+#ifdef CONFIG_KVM_OPTIONS
.default_machine_opts = "accel=kvm,kernel_irqchip=on",
+#endif
.compat_props = (GlobalProperty[]) {
{
.driver = "pc-sysfw",
--
1.7.10.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix default accelerator when building with --disable-kvm
2012-07-06 15:41 [PATCH] Fix default accelerator when building with --disable-kvm Daniel P. Berrange
@ 2012-07-06 15:58 ` Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2012-07-06 15:58 UTC (permalink / raw)
To: Daniel P. Berrange
Cc: kvm@vger.kernel.org, Avi Kivity, Marcelo Tosatti,
Richard W.M. Jones, Serge Hallyn
On 2012-07-06 17:41, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
>
> The following commit
>
> commit 3ad763fcba5bd0ec5a79d4a9b6baeef119dd4a3d
> Author: Jan Kiszka <jan.kiszka@siemens.com>
> Date: Fri Mar 2 10:30:43 2012 +0100
>
> qemu-kvm: Use machine options to configure qemu-kvm defaults
>
> Upstream is moving towards this mechanism, so start using it in qemu-kvm
> already to configure the specific defaults: kvm enabled on, just like
> in-kernel irqchips.
>
> prevents qemu from starting when it has been build with the
> --disable-kvm argument, because the accelerator is hardcoded
> to 'kvm'. This is a regression previously fixed by
>
> commit ce967f6610dcd7b7762dbad5a639fecf42d5c76d
> Author: Daniel P. Berrange <berrange@redhat.com>
> Date: Fri Aug 5 09:50:29 2011 +0100
>
> Fix default accelerator when configured with --disable-kvm
>
> The default accelerator is hardcoded to 'kvm'. This is a fine
> default for qemu-kvm normally, but if the user built with
> ./configure --disable-kvm, then the resulting binaries will
> not work by default
>
> The fix is again to make this conditional on CONFIG_KVM_OPTIONS
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> hw/pc_piix.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/hw/pc_piix.c b/hw/pc_piix.c
> index 98a06fa..35202dd 100644
> --- a/hw/pc_piix.c
> +++ b/hw/pc_piix.c
> @@ -360,7 +360,9 @@ static QEMUMachine pc_machine_v1_2 = {
> .init = pc_init_pci,
> .max_cpus = 255,
> .is_default = 1,
> +#ifdef CONFIG_KVM_OPTIONS
> .default_machine_opts = "accel=kvm,kernel_irqchip=on",
> +#endif
> };
>
> #define PC_COMPAT_1_1 \
> @@ -469,7 +471,9 @@ static QEMUMachine pc_machine_v0_14 = {
> .desc = "Standard PC",
> .init = pc_init_pci,
> .max_cpus = 255,
> +#ifdef CONFIG_KVM_OPTIONS
> .default_machine_opts = "accel=kvm,kernel_irqchip=on",
> +#endif
> .compat_props = (GlobalProperty[]) {
> PC_COMPAT_0_14,
> {
> @@ -503,7 +507,9 @@ static QEMUMachine pc_machine_v0_13 = {
> .desc = "Standard PC",
> .init = pc_init_pci_no_kvmclock,
> .max_cpus = 255,
> +#ifdef CONFIG_KVM_OPTIONS
> .default_machine_opts = "accel=kvm,kernel_irqchip=on",
> +#endif
> .compat_props = (GlobalProperty[]) {
> PC_COMPAT_0_13,
> {
> @@ -541,7 +547,9 @@ static QEMUMachine pc_machine_v0_12 = {
> .desc = "Standard PC",
> .init = pc_init_pci_no_kvmclock,
> .max_cpus = 255,
> +#ifdef CONFIG_KVM_OPTIONS
> .default_machine_opts = "accel=kvm,kernel_irqchip=on",
> +#endif
> .compat_props = (GlobalProperty[]) {
> PC_COMPAT_0_12,
> {
> @@ -575,7 +583,9 @@ static QEMUMachine pc_machine_v0_11 = {
> .desc = "Standard PC, qemu 0.11",
> .init = pc_init_pci_no_kvmclock,
> .max_cpus = 255,
> +#ifdef CONFIG_KVM_OPTIONS
> .default_machine_opts = "accel=kvm,kernel_irqchip=on",
> +#endif
> .compat_props = (GlobalProperty[]) {
> PC_COMPAT_0_11,
> {
> @@ -597,7 +607,9 @@ static QEMUMachine pc_machine_v0_10 = {
> .desc = "Standard PC, qemu 0.10",
> .init = pc_init_pci_no_kvmclock,
> .max_cpus = 255,
> +#ifdef CONFIG_KVM_OPTIONS
> .default_machine_opts = "accel=kvm,kernel_irqchip=on",
> +#endif
> .compat_props = (GlobalProperty[]) {
> PC_COMPAT_0_11,
> {
> @@ -631,7 +643,9 @@ static QEMUMachine isapc_machine = {
> .desc = "ISA-only PC",
> .init = pc_init_isa,
> .max_cpus = 1,
> +#ifdef CONFIG_KVM_OPTIONS
> .default_machine_opts = "accel=kvm,kernel_irqchip=on",
> +#endif
> .compat_props = (GlobalProperty[]) {
> {
> .driver = "pc-sysfw",
>
A bit ugly. You could make it nicer by providing a macro that delivers
the proper options according to the setup - instead of all theses
#ifdefs (would also help to drop redundant kernel_irqchip=on from
master...).
And please provide the corresponding stable fix. I guess that is
currently more important anyway.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-06 15:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-06 15:41 [PATCH] Fix default accelerator when building with --disable-kvm Daniel P. Berrange
2012-07-06 15:58 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox