On 1/17/23 02:46, zhenwei pi wrote: > Introduce crypto device like: > > <crypto model='virtio' type='qemu'> > <backend model='builtin' queues='1'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> > </crypto> > > <crypto model='virtio' type='qemu'> > <backend model='lkcf'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> > </crypto> > > Currently, crypto model supports virtio only, type supports qemu only > (vhost-user in the plan). For the qemu type, backend supports modle > builtin/lkcf, and the queues is optional. > > Changes in this commit: > - docs: formatdomain.rst > - schemas: domaincommon.rng > - conf: crypto related domain conf > - qemu: crypto related > - tests: crypto related test > > Signed-off-by: zhenwei pi <pizhenwei@xxxxxxxxxxxxx> > --- > docs/formatdomain.rst | 21 +++ > src/ch/ch_domain.c | 1 + > src/conf/domain_conf.c | 158 ++++++++++++++++++ > src/conf/domain_conf.h | 39 +++++ > src/conf/domain_postparse.c | 1 + > src/conf/domain_validate.c | 18 ++ > src/conf/schemas/domaincommon.rng | 58 +++++++ > src/conf/virconftypes.h | 2 + > src/libvirt_private.syms | 1 + > src/qemu/qemu_command.c | 1 + > src/qemu/qemu_domain.c | 3 + > src/qemu/qemu_domain_address.c | 26 +++ > src/qemu/qemu_driver.c | 5 + > src/qemu/qemu_hotplug.c | 3 + > src/qemu/qemu_validate.c | 22 +++ > tests/qemuxml2argvdata/crypto-builtin.xml | 51 ++++++ > .../crypto-builtin.x86_64-latest.xml | 1 + > tests/qemuxml2xmltest.c | 2 + > 18 files changed, 413 insertions(+) > create mode 100644 tests/qemuxml2argvdata/crypto-builtin.xml > create mode 120000 tests/qemuxml2xmloutdata/crypto-builtin.x86_64-latest.xml > > diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h > index 3e4985a67d..d99bbbc3ff 100644 > --- a/src/conf/domain_conf.h > +++ b/src/conf/domain_conf.h > @@ -4159,6 +4195,9 @@ VIR_ENUM_DECL(virDomainMemorySource); > VIR_ENUM_DECL(virDomainMemoryAllocation); > VIR_ENUM_DECL(virDomainIOMMUModel); > VIR_ENUM_DECL(virDomainVsockModel); > +VIR_ENUM_DECL(virDomainCryptoModel); > +VIR_ENUM_DECL(virDomainCryptoType); > +VIR_ENUM_DECL(virDomainCryptoBackend); The VIR_ENUM_DECL() macro declares virXXXTypeFromString() and virXXXTypeToString() functions. We'll need to export them too (i.e. add them to src/libvirt_private.syms). They'll be used in next commit during validation (when reporting an error). > VIR_ENUM_DECL(virDomainShmemModel); > VIR_ENUM_DECL(virDomainShmemRole); > VIR_ENUM_DECL(virDomainLaunchSecurity); Michal