Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
libvirt.11330
6fd4c8f8-qemu-domain-sev.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 6fd4c8f8-qemu-domain-sev.patch of Package libvirt.11330
commit 6fd4c8f8785a063112c8161a3a3f5ad3cb6647ea Author: Erik Skultety <eskultet@redhat.com> Date: Tue Jan 22 13:46:16 2019 +0100 qemu: domain: Add /dev/sev into the domain mount namespace selectively Instead of exposing /dev/sev to every domain, do it selectively. Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Index: libvirt-4.0.0/src/qemu/qemu_domain.c =================================================================== --- libvirt-4.0.0.orig/src/qemu/qemu_domain.c +++ libvirt-4.0.0/src/qemu/qemu_domain.c @@ -111,6 +111,7 @@ VIR_ENUM_IMPL(qemuDomainNamespace, QEMU_ #define PROC_MOUNTS "/proc/mounts" #define DEVPREFIX "/dev/" #define DEV_VFIO "/dev/vfio/vfio" +#define DEV_SEV "/dev/sev" struct _qemuDomainLogContext { @@ -9543,6 +9544,26 @@ qemuDomainSetupLoader(virQEMUDriverConfi } +static int +qemuDomainSetupLaunchSecurity(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, + virDomainObjPtr vm, + const struct qemuDomainCreateDeviceData *data) +{ + virDomainSEVDefPtr sev = vm->def->sev; + + if (!sev || sev->sectype != VIR_DOMAIN_LAUNCH_SECURITY_SEV) + return 0; + + VIR_DEBUG("Setting up launch security"); + + if (qemuDomainCreateDevice(DEV_SEV, data, false) < 0) + return -1; + + VIR_DEBUG("Set up launch security"); + return 0; +} + + int qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, virSecurityManagerPtr mgr, @@ -9614,6 +9635,9 @@ qemuDomainBuildNamespace(virQEMUDriverCo if (qemuDomainSetupLoader(cfg, vm, &data) < 0) goto cleanup; + if (qemuDomainSetupLaunchSecurity(cfg, vm, &data) < 0) + goto cleanup; + /* Save some mount points because we want to share them with the host */ for (i = 0; i < ndevMountsPath; i++) { struct stat sb;
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