Skip to contentSkip to conversation

accel: Allow to build QEMU without TCG or KVM support

PATCH Applied Anthony PERARD 3 participants 6 messages Jan 16, 2019 – Jan 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 accel: Allow to build QEMU without TCG or KVM support

Instead of deny build of QEMU without a default accelerator, simply report an error when the user haven't passed -accel or -machine accel= and TCG and KVM isn't builtin.

./configure already check that at least one accelerator is available.

---
 accel/accel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
accel/accel.c +3 -1
index 68b6d56323..0d5b370dfd 100644
@@ -91,7 +91,9 @@ void configure_accelerator(MachineState *ms, const char *progname)
 #elif defined(CONFIG_KVM)
             accel = "kvm";
 #else
-#error "No default accelerator available"
+            error_report("No accelerator selected and"
+                         " no default accelerator available");
+            exit(1);
 #endif
         }
     }
Signature · 1 line
Anthony PERARD
#1 lore raw
Quoted 17 lines · Anthony PERARD

Instead of deny build of QEMU without a default accelerator, simply report an error when the user haven't passed -accel or -machine accel= and TCG and KVM isn't builtin.

./configure already check that at least one accelerator is available.

---
 accel/accel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
accel/accel.c +0 -0
index 68b6d56323..0d5b370dfd 100644

accel/accel.c void configure_accelerator(MachineState *ms, const char *progname) · line 99

Quoted 10 lines
accel/accel.c +3 -1
@@ -91,7 +91,9 @@ void configure_accelerator(MachineState *ms, const char *progname)
 #elif defined(CONFIG_KVM)
             accel = "kvm";
 #else
-#error "No default accelerator available"
+            error_report("No accelerator selected and"
+                         " no default accelerator available");
+            exit(1);
 #endif
         }
     }

Queued, thanks.

Paolo

Reviewed-by on v1 1/1
#2 lore raw
In reply to Anthony PERARD
Quoted 16 lines · Anthony PERARD

Instead of deny build of QEMU without a default accelerator, simply report an error when the user haven't passed -accel or -machine accel= and TCG and KVM isn't builtin.

./configure already check that at least one accelerator is available.

---
 accel/accel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
accel/accel.c +0 -0
index 68b6d56323..0d5b370dfd 100644

accel/accel.c void configure_accelerator(MachineState *ms, const char *progname) · line 99

Quoted 10 lines
accel/accel.c +3 -1
@@ -91,7 +91,9 @@ void configure_accelerator(MachineState *ms, const char *progname)
 #elif defined(CONFIG_KVM)
             accel = "kvm";
 #else
-#error "No default accelerator available"
+            error_report("No accelerator selected and"
+                         " no default accelerator available");
+            exit(1);
 #endif
         }
     }

That looks a little bit friendlier, indeed.

Out of curiosity: Did you hit the #error while compiling? Or just by reading the recent patches?

Thomas

#3 lore raw
Quoted 30 lines · Thomas Huth
Quoted 16 lines · Anthony PERARD

Instead of deny build of QEMU without a default accelerator, simply report an error when the user haven't passed -accel or -machine accel= and TCG and KVM isn't builtin.

./configure already check that at least one accelerator is available.

---
 accel/accel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
accel/accel.c +0 -0
index 68b6d56323..0d5b370dfd 100644

accel/accel.c void configure_accelerator(MachineState *ms, const char *progname) · line 99

Quoted 10 lines
accel/accel.c +3 -1
@@ -91,7 +91,9 @@ void configure_accelerator(MachineState *ms, const char *progname)
 #elif defined(CONFIG_KVM)
             accel = "kvm";
 #else
-#error "No default accelerator available"
+            error_report("No accelerator selected and"
+                         " no default accelerator available");
+            exit(1);
 #endif
         }
     }

That looks a little bit friendlier, indeed.

Quoted 4 lines

Out of curiosity: Did you hit the #error while compiling? Or just by reading the recent patches?

I've hit the #error. I often build QEMU with --disable-tcg --disable-kvm --enable-xen just because I only need to build/test xen. So if I can disable features that I don't need to build QEMU a tiny bit faster, I do :).

Signature · 1 line
Anthony PERARD
#4 lore raw
Quoted 33 lines · Anthony PERARD
Quoted 32 lines · Thomas Huth
Quoted 16 lines · Anthony PERARD

Instead of deny build of QEMU without a default accelerator, simply report an error when the user haven't passed -accel or -machine accel= and TCG and KVM isn't builtin.

./configure already check that at least one accelerator is available.

---
 accel/accel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
accel/accel.c +0 -0
index 68b6d56323..0d5b370dfd 100644

accel/accel.c void configure_accelerator(MachineState *ms, const char *progname) · line 99

Quoted 10 lines
accel/accel.c +3 -1
@@ -91,7 +91,9 @@ void configure_accelerator(MachineState *ms, const char *progname)
 #elif defined(CONFIG_KVM)
             accel = "kvm";
 #else
-#error "No default accelerator available"
+            error_report("No accelerator selected and"
+                         " no default accelerator available");
+            exit(1);
 #endif
         }
     }

That looks a little bit friendlier, indeed.

Quoted 7 lines
Quoted 2 lines

Out of curiosity: Did you hit the #error while compiling? Or just by reading the recent patches?

I've hit the #error. I often build QEMU with --disable-tcg --disable-kvm --enable-xen just because I only need to build/test xen. So if I can disable features that I don't need to build QEMU a tiny bit faster, I do :).

Oh, good to know that this configuration works, too. Maybe you should also add a

#elif defined(CONFIG_XEN)

	accel = "xen";

#...

part in that case?

Thomas

#5 lore raw
Quoted 42 lines · Thomas Huth
Quoted 33 lines · Anthony PERARD
Quoted 32 lines · Thomas Huth
Quoted 16 lines · Anthony PERARD

Instead of deny build of QEMU without a default accelerator, simply report an error when the user haven't passed -accel or -machine accel= and TCG and KVM isn't builtin.

./configure already check that at least one accelerator is available.

---
 accel/accel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
accel/accel.c +0 -0
index 68b6d56323..0d5b370dfd 100644

accel/accel.c void configure_accelerator(MachineState *ms, const char *progname) · line 99

Quoted 10 lines
accel/accel.c +3 -1
@@ -91,7 +91,9 @@ void configure_accelerator(MachineState *ms, const char *progname)
 #elif defined(CONFIG_KVM)
             accel = "kvm";
 #else
-#error "No default accelerator available"
+            error_report("No accelerator selected and"
+                         " no default accelerator available");
+            exit(1);
 #endif
         }
     }

That looks a little bit friendlier, indeed.

Quoted 7 lines
Quoted 2 lines

Out of curiosity: Did you hit the #error while compiling? Or just by reading the recent patches?

I've hit the #error. I often build QEMU with --disable-tcg --disable-kvm --enable-xen just because I only need to build/test xen. So if I can disable features that I don't need to build QEMU a tiny bit faster, I do :).

Quoted 8 lines

Oh, good to know that this configuration works, too. Maybe you should also add a

#elif defined(CONFIG_XEN)

	accel = "xen";

#...

part in that case?

I though about it, but I don't think that's a good idea. We can't start a Xen guests with QEMU alone, so there is always some toolstack that is going to generate the command line anyway. So it's better to always require "-machine accel=xen".

Thanks,

Signature · 1 line
Anthony PERARD