mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +00:00
qemu: Report a more informative error for missing cgroup controllers
Also use VIR_ERR_OPERATION_INVALID instead of VIR_ERR_NO_SUPPORT, as the operation could succeed when the cgroup controller was mounted.
This commit is contained in:
parent
0e629db3bf
commit
1682bcf7d8
@ -3962,7 +3962,7 @@ static int qemudDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
|
||||
|
||||
/* Lack of balloon support is a fatal error */
|
||||
if (r == 0) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cannot set memory of an active domain"));
|
||||
goto endjob;
|
||||
}
|
||||
@ -6980,8 +6980,8 @@ static char *qemuGetSchedulerType(virDomainPtr dom,
|
||||
|
||||
qemuDriverLock(driver);
|
||||
if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
__FUNCTION__);
|
||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cgroup CPU controller is not mounted"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -7011,8 +7011,8 @@ static int qemuDomainSetMemoryParameters(virDomainPtr dom,
|
||||
|
||||
qemuDriverLock(driver);
|
||||
if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_MEMORY)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
__FUNCTION__);
|
||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cgroup memory controller is not mounted"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -7114,8 +7114,8 @@ static int qemuDomainGetMemoryParameters(virDomainPtr dom,
|
||||
qemuDriverLock(driver);
|
||||
|
||||
if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_MEMORY)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
__FUNCTION__);
|
||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cgroup memory controller is not mounted"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -7227,8 +7227,8 @@ static int qemuSetSchedulerParameters(virDomainPtr dom,
|
||||
|
||||
qemuDriverLock(driver);
|
||||
if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
__FUNCTION__);
|
||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cgroup CPU controller is not mounted"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -7292,8 +7292,8 @@ static int qemuGetSchedulerParameters(virDomainPtr dom,
|
||||
|
||||
qemuDriverLock(driver);
|
||||
if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
__FUNCTION__);
|
||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cgroup CPU controller is not mounted"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user