mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: cgroup: Avoid reporting errors from inaccessible NFS volumes
Rather than reporting it and then reseting the error, don't report it in the first place.
This commit is contained in:
parent
cf113e8d54
commit
4e22355ee1
@ -77,7 +77,7 @@ qemuSetImageCgroupInternal(virDomainObjPtr vm,
|
|||||||
|
|
||||||
VIR_DEBUG("Deny path %s", src->path);
|
VIR_DEBUG("Deny path %s", src->path);
|
||||||
|
|
||||||
ret = virCgroupDenyDevicePath(priv->cgroup, src->path, perms, false);
|
ret = virCgroupDenyDevicePath(priv->cgroup, src->path, perms, true);
|
||||||
} else {
|
} else {
|
||||||
if (!src->readonly && !forceReadonly)
|
if (!src->readonly && !forceReadonly)
|
||||||
perms |= VIR_CGROUP_DEVICE_WRITE;
|
perms |= VIR_CGROUP_DEVICE_WRITE;
|
||||||
@ -85,7 +85,7 @@ qemuSetImageCgroupInternal(virDomainObjPtr vm,
|
|||||||
VIR_DEBUG("Allow path %s, perms: %s",
|
VIR_DEBUG("Allow path %s, perms: %s",
|
||||||
src->path, virCgroupGetDevicePermsString(perms));
|
src->path, virCgroupGetDevicePermsString(perms));
|
||||||
|
|
||||||
ret = virCgroupAllowDevicePath(priv->cgroup, src->path, perms, false);
|
ret = virCgroupAllowDevicePath(priv->cgroup, src->path, perms, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
virDomainAuditCgroupPath(vm, priv->cgroup,
|
virDomainAuditCgroupPath(vm, priv->cgroup,
|
||||||
@ -94,14 +94,6 @@ qemuSetImageCgroupInternal(virDomainObjPtr vm,
|
|||||||
virCgroupGetDevicePermsString(perms),
|
virCgroupGetDevicePermsString(perms),
|
||||||
ret == 0);
|
ret == 0);
|
||||||
|
|
||||||
/* Get this for root squash NFS */
|
|
||||||
if (ret < 0 &&
|
|
||||||
virLastErrorIsSystemErrno(EACCES)) {
|
|
||||||
VIR_DEBUG("Ignoring EACCES for %s", src->path);
|
|
||||||
virResetLastError();
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user