Re: [PATCH] qemu: Report a more informative error for missing cgroup controllers

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

 



2011/2/11 Daniel Veillard <veillard@xxxxxxxxxx>:
> On Fri, Feb 11, 2011 at 02:17:55PM +0100, Matthias Bolte wrote:
>> Patch attached.
>>
>> Matthias
>
>> From e50c5ed1fd2e1b1aabd0c10a6fba1af22e787ddf Mon Sep 17 00:00:00 2001
>> From: Matthias Bolte <matthias.bolte@xxxxxxxxxxxxxx>
>> Date: Fri, 11 Feb 2011 11:02:39 +0100
>> Subject: [PATCH] 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.
>> ---
>> Âsrc/qemu/qemu_driver.c | Â 22 +++++++++++-----------
>> Â1 files changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 21d7779..fa462f9 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -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;
>> Â Â Â}
>>
>
> ÂLooks fine to me, ACK
>
> Daniel
>

Thanks, pushed.

Matthias

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