[PATCH] Improve the error info when fail to start guest due to lack of cgroup controller

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

 



When cgroup controller cpu, cpuset and cpuacct are all unmounted,
fail to start guest. The error info is not accurate. It will report
"At least one cgroup controller is required" even though there is
cgroup controller memory or blkio.

Signed-off-by: Shanzhi Yu <shyu@xxxxxxxxxx>
---
 src/util/vircgroup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index fce380a..c609eb3 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -586,6 +586,11 @@ virCgroupDetect(virCgroupPtr group,
                 if (!group->controllers[i].mountPoint) {
                     VIR_DEBUG("Requested controller '%s' not mounted, ignoring",
                               virCgroupControllerTypeToString(i));
+                    if ( i==2 ) {
+                        virReportSystemError(ENXIO, "%s",
+                                            _("At least one cgroup controller cpu or cpuacct or cpuset is required"));	
+                        return -1;
+                    }
                     controllers &= ~(1 << i);
                 }
             } else {
-- 
1.8.3.1

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