Re: [libvirt] [PATCH v2] qemu: Add check for whether KVM nesting is enabled

2018-11-28 Thread Daniel P . Berrangé
On Wed, Nov 28, 2018 at 07:13:05AM -0500, John Ferlan wrote: > > > On 11/28/18 5:02 AM, Daniel P. Berrangé wrote: > > On Tue, Nov 27, 2018 at 02:15:39PM -0500, John Ferlan wrote: > >> > >> > >> On 11/27/18 12:05 PM, Andrea Bolognani wrote: > >>> On Mon, 2018-11-26 at 18:38 -0500, John Ferlan wrot

Re: [libvirt] [PATCH v2] qemu: Add check for whether KVM nesting is enabled

2018-11-28 Thread John Ferlan
On 11/28/18 5:02 AM, Daniel P. Berrangé wrote: > On Tue, Nov 27, 2018 at 02:15:39PM -0500, John Ferlan wrote: >> >> >> On 11/27/18 12:05 PM, Andrea Bolognani wrote: >>> On Mon, 2018-11-26 at 18:38 -0500, John Ferlan wrote: >>> [...] +static bool +virQEMUCapsKVMIsNested(void) +{ >>>

Re: [libvirt] [PATCH v2] qemu: Add check for whether KVM nesting is enabled

2018-11-28 Thread Daniel P . Berrangé
On Tue, Nov 27, 2018 at 02:15:39PM -0500, John Ferlan wrote: > > > On 11/27/18 12:05 PM, Andrea Bolognani wrote: > > On Mon, 2018-11-26 at 18:38 -0500, John Ferlan wrote: > > [...] > >> +static bool > >> +virQEMUCapsKVMIsNested(void) > >> +{ > >> +VIR_AUTOFREE(char *) kConfig = NULL; > >> + >

Re: [libvirt] [PATCH v2] qemu: Add check for whether KVM nesting is enabled

2018-11-28 Thread Andrea Bolognani
On Tue, 2018-11-27 at 14:15 -0500, John Ferlan wrote: > On 11/27/18 12:05 PM, Andrea Bolognani wrote: > > Oh, wait, I get it now: 'modprobe -c' doesn't dump the *current* host > > configuration, but the *static* one! So if you enable nested KVM > > support by doing > > > > # modprobe -r kvm_inte

Re: [libvirt] [PATCH v2] qemu: Add check for whether KVM nesting is enabled

2018-11-27 Thread John Ferlan
On 11/27/18 12:05 PM, Andrea Bolognani wrote: > On Mon, 2018-11-26 at 18:38 -0500, John Ferlan wrote: > [...] >> +static bool >> +virQEMUCapsKVMIsNested(void) >> +{ >> +VIR_AUTOFREE(char *) kConfig = NULL; >> + >> +/* Intel, AMD, and s390 related checks */ >> +if ((kConfig = virKModC

Re: [libvirt] [PATCH v2] qemu: Add check for whether KVM nesting is enabled

2018-11-27 Thread Andrea Bolognani
On Mon, 2018-11-26 at 18:38 -0500, John Ferlan wrote: [...] > +static bool > +virQEMUCapsKVMIsNested(void) > +{ > +VIR_AUTOFREE(char *) kConfig = NULL; > + > +/* Intel, AMD, and s390 related checks */ > +if ((kConfig = virKModConfig()) && > +(strstr(kConfig, "kvm_intel nested=1"

Re: [libvirt] [PATCH v2] qemu: Add check for whether KVM nesting is enabled

2018-11-26 Thread Jiri Denemark
On Mon, Nov 26, 2018 at 18:38:06 -0500, John Ferlan wrote: > Support for nested KVM is handled via a kernel module configuration > adjustment which if done after libvirtd is started and/or the last > QEMU capabilities adjustment can result in the inability to start a > guest and use nested KVM unti

[libvirt] [PATCH v2] qemu: Add check for whether KVM nesting is enabled

2018-11-26 Thread John Ferlan
Support for nested KVM is handled via a kernel module configuration adjustment which if done after libvirtd is started and/or the last QEMU capabilities adjustment can result in the inability to start a guest and use nested KVM until the capabilities cache is invalidated. This is because without kn