[libvirt PATCH] virresctrl: fix starting VMs with cputune.memorytune specified

Pavel Hrdina posted 1 patch 2 years, 10 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/67e05d9cb5e660635bb2fd28cfaffc16fc5fa523.1624273682.git.phrdina@redhat.com
src/util/virresctrl.c | 1 -
1 file changed, 1 deletion(-)
[libvirt PATCH] virresctrl: fix starting VMs with cputune.memorytune specified
Posted by Pavel Hrdina 2 years, 10 months ago
When removing check for return value of VIR_EXPAND_N this place was
incorrectly modified causing failure to start a VM with cputune
memorytune configured with useless error message:

    error: Failed to start domain 'vm1'
    error: An error occurred, but the cause is unknown

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973094
Fixes: 7d2fd6ef0163a939adb7ce0f0fad3b7654c340de
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 src/util/virresctrl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index a03113d4d6..35e92022db 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -1437,7 +1437,6 @@ virResctrlAllocParseProcessMemoryBandwidth(virResctrlInfo *resctrl,
     if (alloc->mem_bw->nbandwidths <= id) {
         VIR_EXPAND_N(alloc->mem_bw->bandwidths, alloc->mem_bw->nbandwidths,
                      id - alloc->mem_bw->nbandwidths + 1);
-        return -1;
     }
     if (!alloc->mem_bw->bandwidths[id])
         alloc->mem_bw->bandwidths[id] = g_new0(unsigned int, 1);
-- 
2.31.1

Re: [libvirt PATCH] virresctrl: fix starting VMs with cputune.memorytune specified
Posted by Jano Tomko 2 years, 10 months ago
On 6/21/21 1:08 PM, Pavel Hrdina wrote:
> When removing check for return value of VIR_EXPAND_N this place was
> incorrectly modified causing failure to start a VM with cputune
> memorytune configured with useless error message:
> 
>     error: Failed to start domain 'vm1'
>     error: An error occurred, but the cause is unknown
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973094
> Fixes: 7d2fd6ef0163a939adb7ce0f0fad3b7654c340de
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  src/util/virresctrl.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
> index a03113d4d6..35e92022db 100644
> --- a/src/util/virresctrl.c
> +++ b/src/util/virresctrl.c
> @@ -1437,7 +1437,6 @@ virResctrlAllocParseProcessMemoryBandwidth(virResctrlInfo *resctrl,
>      if (alloc->mem_bw->nbandwidths <= id) {
>          VIR_EXPAND_N(alloc->mem_bw->bandwidths, alloc->mem_bw->nbandwidths,
>                       id - alloc->mem_bw->nbandwidths + 1);
> -        return -1;
>      }
>      if (!alloc->mem_bw->bandwidths[id])
>          alloc->mem_bw->bandwidths[id] = g_new0(unsigned int, 1);
> 

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano

Re: [libvirt PATCH] virresctrl: fix starting VMs with cputune.memorytune specified
Posted by Peter Krempa 2 years, 10 months ago
On Mon, Jun 21, 2021 at 13:08:19 +0200, Pavel Hrdina wrote:
> When removing check for return value of VIR_EXPAND_N this place was
> incorrectly modified causing failure to start a VM with cputune
> memorytune configured with useless error message:
> 
>     error: Failed to start domain 'vm1'
>     error: An error occurred, but the cause is unknown
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973094
> Fixes: 7d2fd6ef0163a939adb7ce0f0fad3b7654c340de
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  src/util/virresctrl.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>