qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support
@ 2019-01-16 17:35 Anthony PERARD
  2019-01-16 18:14 ` Paolo Bonzini
  2019-01-17  6:02 ` Thomas Huth
  0 siblings, 2 replies; 6+ messages in thread
From: Anthony PERARD @ 2019-01-16 17:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, Paolo Bonzini, 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.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 accel/accel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/accel/accel.c b/accel/accel.c
index 68b6d56323..0d5b370dfd 100644
--- a/accel/accel.c
+++ b/accel/accel.c
@@ -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
         }
     }
-- 
Anthony PERARD

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support
  2019-01-16 17:35 [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support Anthony PERARD
@ 2019-01-16 18:14 ` Paolo Bonzini
  2019-01-17  6:02 ` Thomas Huth
  1 sibling, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2019-01-16 18:14 UTC (permalink / raw)
  To: Anthony PERARD, qemu-devel; +Cc: Thomas Huth

On 16/01/19 18:35, Anthony PERARD wrote:
> 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.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  accel/accel.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/accel/accel.c b/accel/accel.c
> index 68b6d56323..0d5b370dfd 100644
> --- a/accel/accel.c
> +++ b/accel/accel.c
> @@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support
  2019-01-16 17:35 [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support Anthony PERARD
  2019-01-16 18:14 ` Paolo Bonzini
@ 2019-01-17  6:02 ` Thomas Huth
  2019-01-17 10:55   ` Anthony PERARD
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2019-01-17  6:02 UTC (permalink / raw)
  To: Anthony PERARD, qemu-devel; +Cc: Paolo Bonzini

On 2019-01-16 18:35, Anthony PERARD wrote:
> 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.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  accel/accel.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/accel/accel.c b/accel/accel.c
> index 68b6d56323..0d5b370dfd 100644
> --- a/accel/accel.c
> +++ b/accel/accel.c
> @@ -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.

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

 Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support
  2019-01-17  6:02 ` Thomas Huth
@ 2019-01-17 10:55   ` Anthony PERARD
  2019-01-17 11:06     ` Thomas Huth
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony PERARD @ 2019-01-17 10:55 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, Paolo Bonzini

On Thu, Jan 17, 2019 at 07:02:24AM +0100, Thomas Huth wrote:
> On 2019-01-16 18:35, Anthony PERARD wrote:
> > 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.
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> > ---
> >  accel/accel.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/accel/accel.c b/accel/accel.c
> > index 68b6d56323..0d5b370dfd 100644
> > --- a/accel/accel.c
> > +++ b/accel/accel.c
> > @@ -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.
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> 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
:).

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support
  2019-01-17 10:55   ` Anthony PERARD
@ 2019-01-17 11:06     ` Thomas Huth
  2019-01-17 11:23       ` Anthony PERARD
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2019-01-17 11:06 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: qemu-devel, Paolo Bonzini

On 2019-01-17 11:55, Anthony PERARD wrote:
> On Thu, Jan 17, 2019 at 07:02:24AM +0100, Thomas Huth wrote:
>> On 2019-01-16 18:35, Anthony PERARD wrote:
>>> 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.
>>>
>>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>>> ---
>>>  accel/accel.c | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/accel/accel.c b/accel/accel.c
>>> index 68b6d56323..0d5b370dfd 100644
>>> --- a/accel/accel.c
>>> +++ b/accel/accel.c
>>> @@ -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.
>>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>
>> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support
  2019-01-17 11:06     ` Thomas Huth
@ 2019-01-17 11:23       ` Anthony PERARD
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony PERARD @ 2019-01-17 11:23 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, Paolo Bonzini

On Thu, Jan 17, 2019 at 12:06:09PM +0100, Thomas Huth wrote:
> On 2019-01-17 11:55, Anthony PERARD wrote:
> > On Thu, Jan 17, 2019 at 07:02:24AM +0100, Thomas Huth wrote:
> >> On 2019-01-16 18:35, Anthony PERARD wrote:
> >>> 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.
> >>>
> >>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> >>> ---
> >>>  accel/accel.c | 4 +++-
> >>>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/accel/accel.c b/accel/accel.c
> >>> index 68b6d56323..0d5b370dfd 100644
> >>> --- a/accel/accel.c
> >>> +++ b/accel/accel.c
> >>> @@ -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.
> >>
> >> Reviewed-by: Thomas Huth <thuth@redhat.com>
> >>
> >> 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?

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,

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-17 11:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-16 17:35 [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support Anthony PERARD
2019-01-16 18:14 ` Paolo Bonzini
2019-01-17  6:02 ` Thomas Huth
2019-01-17 10:55   ` Anthony PERARD
2019-01-17 11:06     ` Thomas Huth
2019-01-17 11:23       ` Anthony PERARD

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).