[RFC PATCH 1/3] libvirt: Introduce virDomainInjectLaunchSecret public API

Daniel P. Berrangé berrange at redhat.com
Tue Nov 23 17:28:22 UTC 2021


On Tue, Nov 16, 2021 at 07:23:52PM -0700, Jim Fehlig wrote:
> An API inject a launch secret into the domain's memory.
> 
> Signed-off-by: Jim Fehlig <jfehlig at suse.com>
> ---
>  include/libvirt/libvirt-domain.h |  6 ++++
>  src/driver-hypervisor.h          |  8 +++++
>  src/libvirt-domain.c             | 50 ++++++++++++++++++++++++++++++++
>  src/libvirt_public.syms          |  5 ++++
>  4 files changed, 69 insertions(+)
> 
> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
> index 2f017c5b68..418ee4bd2d 100644
> --- a/include/libvirt/libvirt-domain.h
> +++ b/include/libvirt/libvirt-domain.h
> @@ -5091,6 +5091,12 @@ int virDomainGetLaunchSecurityInfo(virDomainPtr domain,
>                                     int *nparams,
>                                     unsigned int flags);
>  
> +int virDomainInjectLaunchSecret(virDomainPtr domain,
> +                                const char *secrethdr,
> +                                const char *secret,
> +                                unsigned long long injectaddr,
> +                                unsigned int flags);

I thought of a better name at last, that shows its relation
to virDomainGetLaunchSecurityInfo without implying that they
are the direct inverse of each other:

  virDomainSetLaunchSecurityState(...)

Also, we whould bear in mind that the set of state parameters
may be differnt for vendors other than AMD, and even later
generations of AMD SEV might want more parameters.

So lets use a 'virTypedParameter' array for this methodeg

  virDomainSetLaunchSecurityState(virDomainPtr dom,
                                  virTypedParameterPtr params,
                                  int nparams,
                                  unsigned int flags);


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 :|




More information about the libvir-list mailing list