[PATCH v5 0/6] Add TPM emulator <source type='file/dir' path='..'/>

marcandre.lureau@redhat.com posted 6 patches 1 year, 3 months ago
Failed in applying to current master (apply log)
docs/formatdomain.rst                         |  22 ++++
src/conf/domain_conf.c                        |  31 ++++-
src/conf/domain_conf.h                        |  12 +-
src/conf/schemas/domaincommon.rng             |  26 ++++
src/qemu/qemu_tpm.c                           | 114 +++++++++++++-----
src/security/security_selinux.c               |   6 +-
src/util/virtpm.c                             |   3 +
src/util/virtpm.h                             |   3 +
.../qemuxmlconfdata/tpm-emulator-tpm2-enc.xml |   1 +
tests/qemuxmlconfdata/tpm-emulator-tpm2.xml   |   1 +
tests/testutilsqemu.c                         |   1 +
11 files changed, 187 insertions(+), 33 deletions(-)
[PATCH v5 0/6] Add TPM emulator <source type='file/dir' path='..'/>
Posted by marcandre.lureau@redhat.com 1 year, 3 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

When swtpm capabilities reports "nvram-backend-dir", it can accepts a single
file or block device where TPM state will be stored.

--tpmstate must be backend-uri=file://.

v5:
- fix indentation
- update doc about state sharing/locking
- add r-b from Stefan

v4:
- add "qemu: explicit swtpm state locking"
- add r-b from Stefan, first patch only atm

v3:
- changed to <source type='file/dir' path='..'/>

v2:
- add <source dir='..'/> support as well (Daniel)

Related: https://issues.redhat.com/browse/CNV-35250

Marc-André Lureau (6):
  util: check swtpm nvram-backend-{dir,file} capabilities
  tpm: rename 'storagepath' to 'source_path'
  schema: add TPM emulator <source type='file' path='..'>
  schema: add TPM emulator <source type='dir' path='..'>
  qemu_tpm: handle file/block storage source
  qemu: explicit swtpm state locking

 docs/formatdomain.rst                         |  22 ++++
 src/conf/domain_conf.c                        |  31 ++++-
 src/conf/domain_conf.h                        |  12 +-
 src/conf/schemas/domaincommon.rng             |  26 ++++
 src/qemu/qemu_tpm.c                           | 114 +++++++++++++-----
 src/security/security_selinux.c               |   6 +-
 src/util/virtpm.c                             |   3 +
 src/util/virtpm.h                             |   3 +
 .../qemuxmlconfdata/tpm-emulator-tpm2-enc.xml |   1 +
 tests/qemuxmlconfdata/tpm-emulator-tpm2.xml   |   1 +
 tests/testutilsqemu.c                         |   1 +
 11 files changed, 187 insertions(+), 33 deletions(-)

-- 
2.47.0
Re: [PATCH v5 0/6] Add TPM emulator <source type='file/dir' path='..'/>
Posted by Marc-André Lureau 1 year, 3 months ago
ping!

On Tue, Oct 22, 2024 at 6:15 PM <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Hi,
>
> When swtpm capabilities reports "nvram-backend-dir", it can accepts a single
> file or block device where TPM state will be stored.
>
> --tpmstate must be backend-uri=file://.
>
> v5:
> - fix indentation
> - update doc about state sharing/locking
> - add r-b from Stefan
>
> v4:
> - add "qemu: explicit swtpm state locking"
> - add r-b from Stefan, first patch only atm
>
> v3:
> - changed to <source type='file/dir' path='..'/>
>
> v2:
> - add <source dir='..'/> support as well (Daniel)
>
> Related: https://issues.redhat.com/browse/CNV-35250
>
> Marc-André Lureau (6):
>   util: check swtpm nvram-backend-{dir,file} capabilities
>   tpm: rename 'storagepath' to 'source_path'
>   schema: add TPM emulator <source type='file' path='..'>
>   schema: add TPM emulator <source type='dir' path='..'>
>   qemu_tpm: handle file/block storage source
>   qemu: explicit swtpm state locking
>
>  docs/formatdomain.rst                         |  22 ++++
>  src/conf/domain_conf.c                        |  31 ++++-
>  src/conf/domain_conf.h                        |  12 +-
>  src/conf/schemas/domaincommon.rng             |  26 ++++
>  src/qemu/qemu_tpm.c                           | 114 +++++++++++++-----
>  src/security/security_selinux.c               |   6 +-
>  src/util/virtpm.c                             |   3 +
>  src/util/virtpm.h                             |   3 +
>  .../qemuxmlconfdata/tpm-emulator-tpm2-enc.xml |   1 +
>  tests/qemuxmlconfdata/tpm-emulator-tpm2.xml   |   1 +
>  tests/testutilsqemu.c                         |   1 +
>  11 files changed, 187 insertions(+), 33 deletions(-)
>
> --
> 2.47.0
>
Re: [PATCH v5 0/6] Add TPM emulator <source type='file/dir' path='..'/>
Posted by Martin Kletzander 1 year, 3 months ago
On Wed, Oct 30, 2024 at 03:35:57PM +0400, Marc-André Lureau wrote:
>ping!
>

Pushed now

>On Tue, Oct 22, 2024 at 6:15 PM <marcandre.lureau@redhat.com> wrote:
>>
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Hi,
>>
>> When swtpm capabilities reports "nvram-backend-dir", it can accepts a single
>> file or block device where TPM state will be stored.
>>
>> --tpmstate must be backend-uri=file://.
>>
>> v5:
>> - fix indentation
>> - update doc about state sharing/locking
>> - add r-b from Stefan
>>
>> v4:
>> - add "qemu: explicit swtpm state locking"
>> - add r-b from Stefan, first patch only atm
>>
>> v3:
>> - changed to <source type='file/dir' path='..'/>
>>
>> v2:
>> - add <source dir='..'/> support as well (Daniel)
>>
>> Related: https://issues.redhat.com/browse/CNV-35250
>>
>> Marc-André Lureau (6):
>>   util: check swtpm nvram-backend-{dir,file} capabilities
>>   tpm: rename 'storagepath' to 'source_path'
>>   schema: add TPM emulator <source type='file' path='..'>
>>   schema: add TPM emulator <source type='dir' path='..'>
>>   qemu_tpm: handle file/block storage source
>>   qemu: explicit swtpm state locking
>>
>>  docs/formatdomain.rst                         |  22 ++++
>>  src/conf/domain_conf.c                        |  31 ++++-
>>  src/conf/domain_conf.h                        |  12 +-
>>  src/conf/schemas/domaincommon.rng             |  26 ++++
>>  src/qemu/qemu_tpm.c                           | 114 +++++++++++++-----
>>  src/security/security_selinux.c               |   6 +-
>>  src/util/virtpm.c                             |   3 +
>>  src/util/virtpm.h                             |   3 +
>>  .../qemuxmlconfdata/tpm-emulator-tpm2-enc.xml |   1 +
>>  tests/qemuxmlconfdata/tpm-emulator-tpm2.xml   |   1 +
>>  tests/testutilsqemu.c                         |   1 +
>>  11 files changed, 187 insertions(+), 33 deletions(-)
>>
>> --
>> 2.47.0
>>
>
Re: [PATCH v5 0/6] Add TPM emulator <source type='file/dir' path='..'/>
Posted by Marc-André Lureau 1 year, 3 months ago
Hi Martin

On Tue, Nov 5, 2024 at 6:42 PM Martin Kletzander <mkletzan@redhat.com> wrote:
>
> On Wed, Oct 30, 2024 at 03:35:57PM +0400, Marc-André Lureau wrote:
> >ping!
> >
>
> Pushed now
>

thanks, though you should have updated the Since v10.9.0 tag in
docs/formatdomain.rst

> >On Tue, Oct 22, 2024 at 6:15 PM <marcandre.lureau@redhat.com> wrote:
> >>
> >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>
> >> Hi,
> >>
> >> When swtpm capabilities reports "nvram-backend-dir", it can accepts a single
> >> file or block device where TPM state will be stored.
> >>
> >> --tpmstate must be backend-uri=file://.
> >>
> >> v5:
> >> - fix indentation
> >> - update doc about state sharing/locking
> >> - add r-b from Stefan
> >>
> >> v4:
> >> - add "qemu: explicit swtpm state locking"
> >> - add r-b from Stefan, first patch only atm
> >>
> >> v3:
> >> - changed to <source type='file/dir' path='..'/>
> >>
> >> v2:
> >> - add <source dir='..'/> support as well (Daniel)
> >>
> >> Related: https://issues.redhat.com/browse/CNV-35250
> >>
> >> Marc-André Lureau (6):
> >>   util: check swtpm nvram-backend-{dir,file} capabilities
> >>   tpm: rename 'storagepath' to 'source_path'
> >>   schema: add TPM emulator <source type='file' path='..'>
> >>   schema: add TPM emulator <source type='dir' path='..'>
> >>   qemu_tpm: handle file/block storage source
> >>   qemu: explicit swtpm state locking
> >>
> >>  docs/formatdomain.rst                         |  22 ++++
> >>  src/conf/domain_conf.c                        |  31 ++++-
> >>  src/conf/domain_conf.h                        |  12 +-
> >>  src/conf/schemas/domaincommon.rng             |  26 ++++
> >>  src/qemu/qemu_tpm.c                           | 114 +++++++++++++-----
> >>  src/security/security_selinux.c               |   6 +-
> >>  src/util/virtpm.c                             |   3 +
> >>  src/util/virtpm.h                             |   3 +
> >>  .../qemuxmlconfdata/tpm-emulator-tpm2-enc.xml |   1 +
> >>  tests/qemuxmlconfdata/tpm-emulator-tpm2.xml   |   1 +
> >>  tests/testutilsqemu.c                         |   1 +
> >>  11 files changed, 187 insertions(+), 33 deletions(-)
> >>
> >> --
> >> 2.47.0
> >>
> >
Re: [PATCH v5 0/6] Add TPM emulator <source type='file/dir' path='..'/>
Posted by Ján Tomko 1 year, 3 months ago
On a Tuesday in 2024, Marc-André Lureau wrote:
>Hi Martin
>
>On Tue, Nov 5, 2024 at 6:42 PM Martin Kletzander <mkletzan@redhat.com> wrote:
>>
>> On Wed, Oct 30, 2024 at 03:35:57PM +0400, Marc-André Lureau wrote:
>> >ping!
>> >
>>
>> Pushed now
>>
>
>thanks, though you should have updated the Since v10.9.0 tag in
>docs/formatdomain.rst
>

Done.

Jano