[libvirt PATCH 0/3] Expose TPM availability in domain capabilities

Daniel P. Berrangé posted 3 patches 2 years, 5 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20211123180408.150785-1-berrange@redhat.com
There is a newer version of this series
docs/schemas/domaincaps.rng                   | 10 ++++++
src/conf/domain_capabilities.c                | 14 ++++++++
src/conf/domain_capabilities.h                | 10 ++++++
src/qemu/qemu_capabilities.c                  | 32 +++++++++++++++++++
src/qemu/qemu_capabilities.h                  |  3 ++
.../domaincapsdata/qemu_2.11.0-q35.x86_64.xml |  9 ++++++
.../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml |  9 ++++++
tests/domaincapsdata/qemu_2.11.0.s390x.xml    |  6 ++++
tests/domaincapsdata/qemu_2.11.0.x86_64.xml   |  9 ++++++
.../domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 10 ++++++
.../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml | 10 ++++++
.../qemu_2.12.0-virt.aarch64.xml              |  6 ++++
tests/domaincapsdata/qemu_2.12.0.aarch64.xml  |  6 ++++
tests/domaincapsdata/qemu_2.12.0.ppc64.xml    |  6 ++++
tests/domaincapsdata/qemu_2.12.0.s390x.xml    |  6 ++++
tests/domaincapsdata/qemu_2.12.0.x86_64.xml   | 10 ++++++
.../domaincapsdata/qemu_3.0.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml  | 10 ++++++
tests/domaincapsdata/qemu_3.0.0.ppc64.xml     |  6 ++++
tests/domaincapsdata/qemu_3.0.0.s390x.xml     |  6 ++++
tests/domaincapsdata/qemu_3.0.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_3.1.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml  | 10 ++++++
tests/domaincapsdata/qemu_3.1.0.ppc64.xml     |  6 ++++
tests/domaincapsdata/qemu_3.1.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_4.0.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml  | 10 ++++++
.../qemu_4.0.0-virt.aarch64.xml               |  4 +++
tests/domaincapsdata/qemu_4.0.0.aarch64.xml   |  4 +++
tests/domaincapsdata/qemu_4.0.0.ppc64.xml     |  4 +++
tests/domaincapsdata/qemu_4.0.0.s390x.xml     |  4 +++
tests/domaincapsdata/qemu_4.0.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_4.1.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml  | 10 ++++++
tests/domaincapsdata/qemu_4.1.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  | 10 ++++++
.../qemu_4.2.0-virt.aarch64.xml               |  4 +++
tests/domaincapsdata/qemu_4.2.0.aarch64.xml   |  4 +++
tests/domaincapsdata/qemu_4.2.0.ppc64.xml     |  6 ++++
tests/domaincapsdata/qemu_4.2.0.s390x.xml     |  4 +++
tests/domaincapsdata/qemu_4.2.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  | 10 ++++++
.../qemu_5.0.0-virt.aarch64.xml               |  9 ++++++
tests/domaincapsdata/qemu_5.0.0.aarch64.xml   |  9 ++++++
tests/domaincapsdata/qemu_5.0.0.ppc64.xml     | 10 ++++++
tests/domaincapsdata/qemu_5.0.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_5.1.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  | 10 ++++++
tests/domaincapsdata/qemu_5.1.0.sparc.xml     |  4 +++
tests/domaincapsdata/qemu_5.1.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_5.2.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  | 10 ++++++
.../qemu_5.2.0-virt.aarch64.xml               |  9 ++++++
tests/domaincapsdata/qemu_5.2.0.aarch64.xml   |  9 ++++++
tests/domaincapsdata/qemu_5.2.0.ppc64.xml     | 10 ++++++
tests/domaincapsdata/qemu_5.2.0.s390x.xml     |  4 +++
tests/domaincapsdata/qemu_5.2.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_6.0.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml  | 10 ++++++
.../qemu_6.0.0-virt.aarch64.xml               |  9 ++++++
tests/domaincapsdata/qemu_6.0.0.aarch64.xml   |  9 ++++++
tests/domaincapsdata/qemu_6.0.0.s390x.xml     |  4 +++
tests/domaincapsdata/qemu_6.0.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_6.1.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml  | 10 ++++++
tests/domaincapsdata/qemu_6.1.0.x86_64.xml    | 10 ++++++
.../domaincapsdata/qemu_6.2.0-q35.x86_64.xml  | 10 ++++++
.../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml  | 10 ++++++
.../qemu_6.2.0-virt.aarch64.xml               |  9 ++++++
tests/domaincapsdata/qemu_6.2.0.aarch64.xml   |  9 ++++++
tests/domaincapsdata/qemu_6.2.0.ppc64.xml     | 10 ++++++
tests/domaincapsdata/qemu_6.2.0.x86_64.xml    | 10 ++++++
tests/domaincapstest.c                        |  9 ++++++
75 files changed, 661 insertions(+)
[libvirt PATCH 0/3] Expose TPM availability in domain capabilities
Posted by Daniel P. Berrangé 2 years, 5 months ago
If we can report whuether TPM is available, then mgmt apps can enable it
by default for new VMs. This is important because OS like Win11 consider
TPM to be mandatory.

Daniel P. Berrangé (3):
  conf: add TPM devices to domain capabilities
  qemu: fill in domain capabilities for TPMs
  qemu: mock swtpm initialization in tests

 docs/schemas/domaincaps.rng                   | 10 ++++++
 src/conf/domain_capabilities.c                | 14 ++++++++
 src/conf/domain_capabilities.h                | 10 ++++++
 src/qemu/qemu_capabilities.c                  | 32 +++++++++++++++++++
 src/qemu/qemu_capabilities.h                  |  3 ++
 .../domaincapsdata/qemu_2.11.0-q35.x86_64.xml |  9 ++++++
 .../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml |  9 ++++++
 tests/domaincapsdata/qemu_2.11.0.s390x.xml    |  6 ++++
 tests/domaincapsdata/qemu_2.11.0.x86_64.xml   |  9 ++++++
 .../domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 10 ++++++
 .../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml | 10 ++++++
 .../qemu_2.12.0-virt.aarch64.xml              |  6 ++++
 tests/domaincapsdata/qemu_2.12.0.aarch64.xml  |  6 ++++
 tests/domaincapsdata/qemu_2.12.0.ppc64.xml    |  6 ++++
 tests/domaincapsdata/qemu_2.12.0.s390x.xml    |  6 ++++
 tests/domaincapsdata/qemu_2.12.0.x86_64.xml   | 10 ++++++
 .../domaincapsdata/qemu_3.0.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml  | 10 ++++++
 tests/domaincapsdata/qemu_3.0.0.ppc64.xml     |  6 ++++
 tests/domaincapsdata/qemu_3.0.0.s390x.xml     |  6 ++++
 tests/domaincapsdata/qemu_3.0.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_3.1.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml  | 10 ++++++
 tests/domaincapsdata/qemu_3.1.0.ppc64.xml     |  6 ++++
 tests/domaincapsdata/qemu_3.1.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_4.0.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml  | 10 ++++++
 .../qemu_4.0.0-virt.aarch64.xml               |  4 +++
 tests/domaincapsdata/qemu_4.0.0.aarch64.xml   |  4 +++
 tests/domaincapsdata/qemu_4.0.0.ppc64.xml     |  4 +++
 tests/domaincapsdata/qemu_4.0.0.s390x.xml     |  4 +++
 tests/domaincapsdata/qemu_4.0.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_4.1.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml  | 10 ++++++
 tests/domaincapsdata/qemu_4.1.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  | 10 ++++++
 .../qemu_4.2.0-virt.aarch64.xml               |  4 +++
 tests/domaincapsdata/qemu_4.2.0.aarch64.xml   |  4 +++
 tests/domaincapsdata/qemu_4.2.0.ppc64.xml     |  6 ++++
 tests/domaincapsdata/qemu_4.2.0.s390x.xml     |  4 +++
 tests/domaincapsdata/qemu_4.2.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  | 10 ++++++
 .../qemu_5.0.0-virt.aarch64.xml               |  9 ++++++
 tests/domaincapsdata/qemu_5.0.0.aarch64.xml   |  9 ++++++
 tests/domaincapsdata/qemu_5.0.0.ppc64.xml     | 10 ++++++
 tests/domaincapsdata/qemu_5.0.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  | 10 ++++++
 tests/domaincapsdata/qemu_5.1.0.sparc.xml     |  4 +++
 tests/domaincapsdata/qemu_5.1.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  | 10 ++++++
 .../qemu_5.2.0-virt.aarch64.xml               |  9 ++++++
 tests/domaincapsdata/qemu_5.2.0.aarch64.xml   |  9 ++++++
 tests/domaincapsdata/qemu_5.2.0.ppc64.xml     | 10 ++++++
 tests/domaincapsdata/qemu_5.2.0.s390x.xml     |  4 +++
 tests/domaincapsdata/qemu_5.2.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml  | 10 ++++++
 .../qemu_6.0.0-virt.aarch64.xml               |  9 ++++++
 tests/domaincapsdata/qemu_6.0.0.aarch64.xml   |  9 ++++++
 tests/domaincapsdata/qemu_6.0.0.s390x.xml     |  4 +++
 tests/domaincapsdata/qemu_6.0.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml  | 10 ++++++
 tests/domaincapsdata/qemu_6.1.0.x86_64.xml    | 10 ++++++
 .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml  | 10 ++++++
 .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml  | 10 ++++++
 .../qemu_6.2.0-virt.aarch64.xml               |  9 ++++++
 tests/domaincapsdata/qemu_6.2.0.aarch64.xml   |  9 ++++++
 tests/domaincapsdata/qemu_6.2.0.ppc64.xml     | 10 ++++++
 tests/domaincapsdata/qemu_6.2.0.x86_64.xml    | 10 ++++++
 tests/domaincapstest.c                        |  9 ++++++
 75 files changed, 661 insertions(+)

-- 
2.33.1


Re: [libvirt PATCH 0/3] Expose TPM availability in domain capabilities
Posted by Michal Prívozník 2 years, 5 months ago
On 11/23/21 19:04, Daniel P. Berrangé wrote:
> If we can report whuether TPM is available, then mgmt apps can enable it
> by default for new VMs. This is important because OS like Win11 consider
> TPM to be mandatory.
> 
> Daniel P. Berrangé (3):
>   conf: add TPM devices to domain capabilities
>   qemu: fill in domain capabilities for TPMs
>   qemu: mock swtpm initialization in tests
> 

>  75 files changed, 661 insertions(+)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal

Re: [libvirt PATCH 0/3] Expose TPM availability in domain capabilities
Posted by Jiri Denemark 2 years, 5 months ago
On Wed, Nov 24, 2021 at 10:06:12 +0100, Michal Prívozník wrote:
> On 11/23/21 19:04, Daniel P. Berrangé wrote:
> > If we can report whuether TPM is available, then mgmt apps can enable it
> > by default for new VMs. This is important because OS like Win11 consider
> > TPM to be mandatory.
> > 
> > Daniel P. Berrangé (3):
> >   conf: add TPM devices to domain capabilities
> >   qemu: fill in domain capabilities for TPMs
> >   qemu: mock swtpm initialization in tests
> > 
> 
> >  75 files changed, 661 insertions(+)
> > 
> 
> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

I agree, but I think 3/3 and 2/3 should be swapped because the build
after the current 2/3 depends on host configuration. So chances are the
build might fail for someone at that point.

Jirka

Re: [libvirt PATCH 0/3] Expose TPM availability in domain capabilities
Posted by Daniel P. Berrangé 2 years, 5 months ago
On Wed, Nov 24, 2021 at 10:11:44AM +0100, Jiri Denemark wrote:
> On Wed, Nov 24, 2021 at 10:06:12 +0100, Michal Prívozník wrote:
> > On 11/23/21 19:04, Daniel P. Berrangé wrote:
> > > If we can report whuether TPM is available, then mgmt apps can enable it
> > > by default for new VMs. This is important because OS like Win11 consider
> > > TPM to be mandatory.
> > > 
> > > Daniel P. Berrangé (3):
> > >   conf: add TPM devices to domain capabilities
> > >   qemu: fill in domain capabilities for TPMs
> > >   qemu: mock swtpm initialization in tests
> > > 
> > 
> > >  75 files changed, 661 insertions(+)
> > > 
> > 
> > Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
> 
> I agree, but I think 3/3 and 2/3 should be swapped because the build
> after the current 2/3 depends on host configuration. So chances are the
> build might fail for someone at that point.

Hmm, it shouldn't depend on host config, because virFindFileInPath
is mocked in testutuilsqemu.c which prevents the test suite from
ever detecting swtpm.

Did you see a particular problem ?

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [libvirt PATCH 0/3] Expose TPM availability in domain capabilities
Posted by Peter Krempa 2 years, 5 months ago
On Wed, Nov 24, 2021 at 09:15:44 +0000, Daniel P. Berrangé wrote:
> On Wed, Nov 24, 2021 at 10:11:44AM +0100, Jiri Denemark wrote:
> > On Wed, Nov 24, 2021 at 10:06:12 +0100, Michal Prívozník wrote:
> > > On 11/23/21 19:04, Daniel P. Berrangé wrote:
> > > > If we can report whuether TPM is available, then mgmt apps can enable it
> > > > by default for new VMs. This is important because OS like Win11 consider
> > > > TPM to be mandatory.
> > > > 
> > > > Daniel P. Berrangé (3):
> > > >   conf: add TPM devices to domain capabilities
> > > >   qemu: fill in domain capabilities for TPMs
> > > >   qemu: mock swtpm initialization in tests
> > > > 
> > > 
> > > >  75 files changed, 661 insertions(+)
> > > > 
> > > 
> > > Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
> > 
> > I agree, but I think 3/3 and 2/3 should be swapped because the build
> > after the current 2/3 depends on host configuration. So chances are the
> > build might fail for someone at that point.
> 
> Hmm, it shouldn't depend on host config, because virFindFileInPath
> is mocked in testutuilsqemu.c which prevents the test suite from
> ever detecting swtpm.
> 
> Did you see a particular problem ?

No it actually works as expected. I've tried both when swtpm is present
and when not present and both cases work well.

Re: [libvirt PATCH 0/3] Expose TPM availability in domain capabilities
Posted by Jiri Denemark 2 years, 5 months ago
On Wed, Nov 24, 2021 at 09:15:44 +0000, Daniel P. Berrangé wrote:
> On Wed, Nov 24, 2021 at 10:11:44AM +0100, Jiri Denemark wrote:
> > On Wed, Nov 24, 2021 at 10:06:12 +0100, Michal Prívozník wrote:
> > > On 11/23/21 19:04, Daniel P. Berrangé wrote:
> > > > If we can report whuether TPM is available, then mgmt apps can enable it
> > > > by default for new VMs. This is important because OS like Win11 consider
> > > > TPM to be mandatory.
> > > > 
> > > > Daniel P. Berrangé (3):
> > > >   conf: add TPM devices to domain capabilities
> > > >   qemu: fill in domain capabilities for TPMs
> > > >   qemu: mock swtpm initialization in tests
> > > > 
> > > 
> > > >  75 files changed, 661 insertions(+)
> > > > 
> > > 
> > > Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
> > 
> > I agree, but I think 3/3 and 2/3 should be swapped because the build
> > after the current 2/3 depends on host configuration. So chances are the
> > build might fail for someone at that point.
> 
> Hmm, it shouldn't depend on host config, because virFindFileInPath
> is mocked in testutuilsqemu.c which prevents the test suite from
> ever detecting swtpm.

Oh, I didn't realize that. Let's just pretend I haven't said anything
:-)

Jirka