Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15:Update
libvirt.11701
a12278a1-remote-launch-security.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File a12278a1-remote-launch-security.patch of Package libvirt.11701
commit a12278a165d35bdec32f4ea8a5282d259aa16c75 Author: Brijesh Singh <brijesh.singh@amd.com> Date: Fri Jun 8 09:41:00 2018 -0500 remote: Implement the remote protocol for launch security Add remote support for launch security info. Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Erik Skultety <eskultet@redhat.com> Index: libvirt-4.0.0/src/remote/remote_driver.c =================================================================== --- libvirt-4.0.0.orig/src/remote/remote_driver.c +++ libvirt-4.0.0/src/remote/remote_driver.c @@ -1952,6 +1952,45 @@ remoteDomainGetNumaParameters(virDomainP } static int +remoteDomainGetLaunchSecurityInfo(virDomainPtr domain, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags) +{ + int rv = -1; + remote_domain_get_launch_security_info_args args; + remote_domain_get_launch_security_info_ret ret; + struct private_data *priv = domain->conn->privateData; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, domain); + args.flags = flags; + + memset(&ret, 0, sizeof(ret)); + if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_LAUNCH_SECURITY_INFO, + (xdrproc_t) xdr_remote_domain_get_launch_security_info_args, (char *) &args, + (xdrproc_t) xdr_remote_domain_get_launch_security_info_ret, (char *) &ret) == -1) + goto done; + + if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + ret.params.params_len, + REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX, + params, + nparams) < 0) + goto cleanup; + + rv = 0; + + cleanup: + xdr_free((xdrproc_t) xdr_remote_domain_get_launch_security_info_ret, + (char *) &ret); + done: + remoteDriverUnlock(priv); + return rv; +} + +static int remoteDomainGetPerfEvents(virDomainPtr domain, virTypedParameterPtr *params, int *nparams, @@ -8538,6 +8577,7 @@ static virHypervisorDriver hypervisor_dr .domainSetBlockThreshold = remoteDomainSetBlockThreshold, /* 3.2.0 */ .domainSetLifecycleAction = remoteDomainSetLifecycleAction, /* 3.9.0 */ .nodeGetSEVInfo = remoteNodeGetSEVInfo, /* 4.0.0 */ + .domainGetLaunchSecurityInfo = remoteDomainGetLaunchSecurityInfo, /* 4.0.0 */ }; static virNetworkDriver network_driver = { Index: libvirt-4.0.0/src/remote/remote_protocol.x =================================================================== --- libvirt-4.0.0.orig/src/remote/remote_protocol.x +++ libvirt-4.0.0/src/remote/remote_protocol.x @@ -256,6 +256,9 @@ const REMOTE_DOMAIN_GUEST_VCPU_PARAMS_MA /* Upper limit on number of SEV parameters */ const REMOTE_NODE_SEV_INFO_MAX = 64; +/* Upper limit on number of launch security information entries */ +const REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX = 64; + /* UUID. VIR_UUID_BUFLEN definition comes from libvirt.h */ typedef opaque remote_uuid[VIR_UUID_BUFLEN]; @@ -3453,6 +3456,14 @@ struct remote_node_get_sev_info_ret { int nparams; }; +struct remote_domain_get_launch_security_info_args { + remote_nonnull_domain dom; + unsigned int flags; +}; + +struct remote_domain_get_launch_security_info_ret { + remote_typed_param params<REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX>; +}; /*----- Protocol. -----*/ @@ -6140,5 +6151,11 @@ enum remote_procedure { * @generate: none * @acl: connect:read */ - REMOTE_PROC_NODE_GET_SEV_INFO = 395 + REMOTE_PROC_NODE_GET_SEV_INFO = 395, + + /** + * @generate: none + * @acl: domain:read + */ + REMOTE_PROC_DOMAIN_GET_LAUNCH_SECURITY_INFO = 396 }; Index: libvirt-4.0.0/src/remote_protocol-structs =================================================================== --- libvirt-4.0.0.orig/src/remote_protocol-structs +++ libvirt-4.0.0/src/remote_protocol-structs @@ -2882,6 +2882,16 @@ struct remote_node_get_sev_info_ret { } params; int nparams; }; +struct remote_domain_get_launch_security_info_args { + remote_nonnull_domain dom; + u_int flags; +}; +struct remote_domain_get_launch_security_info_ret { + struct { + u_int params_len; + remote_typed_param * params_val; + } params; +}; enum remote_procedure { REMOTE_PROC_CONNECT_OPEN = 1, REMOTE_PROC_CONNECT_CLOSE = 2, @@ -3274,4 +3284,5 @@ enum remote_procedure { REMOTE_PROC_DOMAIN_MANAGED_SAVE_DEFINE_XML = 389, REMOTE_PROC_DOMAIN_SET_LIFECYCLE_ACTION = 390, REMOTE_PROC_NODE_GET_SEV_INFO = 395, + REMOTE_PROC_DOMAIN_GET_LAUNCH_SECURITY_INFO = 396, }; Index: libvirt-4.0.0/daemon/remote.c =================================================================== --- libvirt-4.0.0.orig/daemon/remote.c +++ libvirt-4.0.0/daemon/remote.c @@ -3088,6 +3088,53 @@ remoteDispatchNodeGetMemoryStats(virNetS } static int +remoteDispatchDomainGetLaunchSecurityInfo(virNetServerPtr server ATTRIBUTE_UNUSED, + virNetServerClientPtr client ATTRIBUTE_UNUSED, + virNetMessagePtr msg ATTRIBUTE_UNUSED, + virNetMessageErrorPtr rerr, + remote_domain_get_launch_security_info_args *args, + remote_domain_get_launch_security_info_ret *ret) +{ + virDomainPtr dom = NULL; + virTypedParameterPtr params = NULL; + int nparams = 0; + int rv = -1; + struct daemonClientPrivate *priv = + virNetServerClientGetPrivateData(client); + + if (!priv->conn) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open")); + goto cleanup; + } + + if (!(dom = get_nonnull_domain(priv->conn, args->dom))) + goto cleanup; + + if (virDomainGetLaunchSecurityInfo(dom, ¶ms, &nparams, args->flags) < 0) + goto cleanup; + + if (nparams > REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; + } + + if (virTypedParamsSerialize(params, nparams, + (virTypedParameterRemotePtr *) &ret->params.params_val, + &ret->params.params_len, + args->flags) < 0) + goto cleanup; + + rv = 0; + + cleanup: + if (rv < 0) + virNetMessageSaveError(rerr); + virTypedParamsFree(params, nparams); + virObjectUnref(dom); + return rv; +} + +static int remoteDispatchDomainGetPerfEvents(virNetServerPtr server ATTRIBUTE_UNUSED, virNetServerClientPtr client ATTRIBUTE_UNUSED, virNetMessagePtr msg ATTRIBUTE_UNUSED,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor