[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-04 Thread Paolo Bonzini
The reason is to avoid including kvm.h by vl.c. But that's not a problem, kvm.h can be included by compiled-once files; that was the reason to introduce the stubs in the first place. kvm_* should be declared in kvm.h. That can't be safe because CONFIG_KVM will not be defined for files com

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-04 Thread Blue Swirl
On 4/4/10, Paolo Bonzini wrote: > On 04/03/2010 11:07 AM, Blue Swirl wrote: > > > On 4/3/10, Paolo Bonzini wrote: > > > > > On 04/02/2010 09:04 PM, Blue Swirl wrote: > > > > > > > > > > -int kvm_init(int smp_cpus); > > > > > > > > > > > > > > I had missed this; I don't see a particular reason to

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-04 Thread Paolo Bonzini
On 04/03/2010 11:07 AM, Blue Swirl wrote: On 4/3/10, Paolo Bonzini wrote: On 04/02/2010 09:04 PM, Blue Swirl wrote: -int kvm_init(int smp_cpus); I had missed this; I don't see a particular reason to move this out of kvm.h. Anyway I don't feel strongly about this. The reason is to avoi

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-03 Thread Blue Swirl
On 4/3/10, Paolo Bonzini wrote: > On 04/02/2010 09:04 PM, Blue Swirl wrote: > > > -int kvm_init(int smp_cpus); > > > > I had missed this; I don't see a particular reason to move this out of > kvm.h. Anyway I don't feel strongly about this. The reason is to avoid including kvm.h by vl.c.

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-03 Thread Paolo Bonzini
On 04/02/2010 09:04 PM, Blue Swirl wrote: -int kvm_init(int smp_cpus); I had missed this; I don't see a particular reason to move this out of kvm.h. Anyway I don't feel strongly about this. Paolo

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-02 Thread Blue Swirl
On 4/2/10, Paolo Bonzini wrote: > On 04/02/2010 08:17 PM, Blue Swirl wrote: > > > I merged your patch and mine. Does it still look reasonable? > > > > Yes, of course. I'd rather see them committed separately though. This version is designed to be applied after your patch. I made my patch a bit

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-02 Thread Paolo Bonzini
On 04/02/2010 08:17 PM, Blue Swirl wrote: I merged your patch and mine. Does it still look reasonable? Yes, of course. I'd rather see them committed separately though. Paolo

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-02 Thread Blue Swirl
On 4/2/10, Paolo Bonzini wrote: > On 04/02/2010 07:29 PM, Blue Swirl wrote: > > > Could you stub also kvm_init? > > > > It is stubbed, but it returns ENOSYS: > > +int kvm_init(int smp_cpus) > +{ > +return -ENOSYS; > +} > + Sorry, I expected this to be near the end. > and in fact

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-02 Thread Paolo Bonzini
On 04/02/2010 07:29 PM, Blue Swirl wrote: Could you stub also kvm_init? It is stubbed, but it returns ENOSYS: +int kvm_init(int smp_cpus) +{ +return -ENOSYS; +} + and in fact I'm relying this to remove this: if (!(kvm_available())) { printf("Option %s not supported for this ta

[Qemu-devel] Re: [PATCH] provide a stub version of kvm-all.c if !CONFIG_KVM

2010-04-02 Thread Blue Swirl
On 4/2/10, Paolo Bonzini wrote: > This allows limited use of kvm functions (which will return ENOSYS) > even in once-compiled modules. The patch also improves a bit the error > messages for KVM initialization. > > Signed-off-by: Paolo Bonzini > --- > What about this instead? I don't