On 1/4/23 04:29, zhenwei pi wrote: > Detect virtio crypto/crypto backend capabilities from QEMU, then we > have a domain(QEMU) like this: > <crypto supported='yes'> > <enum name='model'> > <value>virtio</value> > </enum> > <enum name='type'> > <value>qemu</value> > </enum> > <enum name='backendModel'> > <value>builtin</value> > <value>lkcf</value> > </enum> > </crypto> > > Signed-off-by: zhenwei pi <pizhenwei@xxxxxxxxxxxxx> > --- > src/conf/schemas/domaincaps.rng | 10 ++++++ > src/qemu/qemu_capabilities.c | 32 +++++++++++++++++++ > src/qemu/qemu_capabilities.h | 8 +++++ > .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 11 +++++++ > .../qemu_4.2.0-virt.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 11 +++++++ > tests/domaincapsdata/qemu_4.2.0.s390x.xml | 11 +++++++ > tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 11 +++++++ > .../qemu_5.0.0-virt.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 11 +++++++ > tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 11 +++++++ > tests/domaincapsdata/qemu_5.1.0.sparc.xml | 9 ++++++ > tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 11 +++++++ > .../qemu_5.2.0-virt.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 11 +++++++ > tests/domaincapsdata/qemu_5.2.0.s390x.xml | 11 +++++++ > tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 11 +++++++ > .../qemu_6.0.0-virt.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_6.0.0.s390x.xml | 11 +++++++ > tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 11 +++++++ > tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 11 +++++++ > .../qemu_6.2.0-virt.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 11 +++++++ > tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 11 +++++++ > .../qemu_7.0.0-virt.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 11 +++++++ > tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 11 +++++++ > tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 11 +++++++ > tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 11 +++++++ > tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 11 +++++++ > .../domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 12 +++++++ > .../domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 12 +++++++ > tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 12 +++++++ > .../caps_4.2.0.aarch64.xml | 2 ++ > .../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 2 ++ > .../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 2 ++ > .../caps_4.2.0.x86_64.xml | 2 ++ > .../caps_5.0.0.aarch64.xml | 2 ++ > .../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 2 ++ > .../caps_5.0.0.riscv64.xml | 2 ++ > .../caps_5.0.0.x86_64.xml | 2 ++ > .../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 + > .../caps_5.1.0.x86_64.xml | 2 ++ > .../caps_5.2.0.aarch64.xml | 2 ++ > .../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 2 ++ > .../caps_5.2.0.riscv64.xml | 2 ++ > .../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 2 ++ > .../caps_5.2.0.x86_64.xml | 2 ++ > .../caps_6.0.0.aarch64.xml | 2 ++ > .../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 2 ++ > .../caps_6.0.0.x86_64.xml | 2 ++ > .../caps_6.1.0.x86_64.xml | 2 ++ > .../caps_6.2.0.aarch64.xml | 2 ++ > .../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 2 ++ > .../caps_6.2.0.x86_64.xml | 2 ++ > .../caps_7.0.0.aarch64.xml | 2 ++ > .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 ++ > .../caps_7.0.0.x86_64.xml | 2 ++ > .../qemucapabilitiesdata/caps_7.1.0.ppc64.xml | 2 ++ > .../caps_7.1.0.x86_64.xml | 2 ++ > .../caps_7.2.0.x86_64.xml | 3 ++ > 83 files changed, 679 insertions(+) > > diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng > index b6408bca88..232c976530 100644 > --- a/src/conf/schemas/domaincaps.rng > +++ b/src/conf/schemas/domaincaps.rng > @@ -204,6 +204,9 @@ > <optional> > <ref name="channel"/> > </optional> > + <optional> > + <ref name="crypto"/> > + </optional> > </element> > </define> > > @@ -270,6 +273,13 @@ > </element> > </define> > > + <define name="crypto"> > + <element name="crypto"> > + <ref name="supported"/> > + <ref name="enum"/> > + </element> > + </define> > + > <define name="features"> > <element name="features"> > <optional> These two hunks should be squashed into previous patch. Michal