[PATCH 10/10] qemu: cgroup: Setup cgroups for bios/firmware images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



oVirt wants to use OVMF images on top of lvm for their 'logical'
storage thus we should set up device ACLs for them so it will actually
work.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1305922
---
 src/qemu/qemu_cgroup.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 9f24545..90f8397 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -548,6 +548,23 @@ qemuSetupMemoryCgroup(virDomainObjPtr vm)


 static int
+qemuSetupFirmwareCgroup(virDomainObjPtr vm)
+{
+    bool readonly = vm->def->os.loader->readonly == VIR_TRISTATE_BOOL_YES;
+
+    if (vm->def->os.loader->path &&
+        qemuSetupImagePathCgroup(vm, vm->def->os.loader->path, readonly) < 0)
+        return -1;
+
+    if (vm->def->os.loader->nvram &&
+        qemuSetupImagePathCgroup(vm, vm->def->os.loader->nvram, false) < 0)
+        return -1;
+
+    return 0;
+}
+
+
+static int
 qemuSetupDevicesCgroup(virQEMUDriverPtr driver,
                        virDomainObjPtr vm)
 {
@@ -573,6 +590,9 @@ qemuSetupDevicesCgroup(virQEMUDriverPtr driver,
         goto cleanup;
     }

+    if (qemuSetupFirmwareCgroup(vm) < 0)
+        goto cleanup;
+
     for (i = 0; i < vm->def->ndisks; i++) {
         if (qemuSetupDiskCgroup(vm, vm->def->disks[i]) < 0)
             goto cleanup;
-- 
2.6.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]