mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cgroup: Fix start VMs coincidently failed
When I start multi VMs coincidently and any of the cgroup directories named machine doesn't exist. There's a chance that VM start failed because of creating directory failed: Unable to initialize /machine cgroup: File exists When the errno returned by mkdir in virCgroupMakeGroup is EEXIST, we should pass it through and continue to start the VM. Signed-off-by: Wang Yufei <james.wangyufei@huawei.com>
This commit is contained in:
parent
edff187a39
commit
bfb29654c8
@ -924,6 +924,10 @@ virCgroupMakeGroup(virCgroupPtr parent,
|
|||||||
if (!virFileExists(path)) {
|
if (!virFileExists(path)) {
|
||||||
if (!create ||
|
if (!create ||
|
||||||
mkdir(path, 0755) < 0) {
|
mkdir(path, 0755) < 0) {
|
||||||
|
if (errno == EEXIST) {
|
||||||
|
VIR_FREE(path);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
/* With a kernel that doesn't support multi-level directory
|
/* With a kernel that doesn't support multi-level directory
|
||||||
* for blkio controller, libvirt will fail and disable all
|
* for blkio controller, libvirt will fail and disable all
|
||||||
* other controllers even though they are available. So
|
* other controllers even though they are available. So
|
||||||
|
Loading…
Reference in New Issue
Block a user