[libvirt PATCH] qemu_driver: fix setting vcpu_quota if not all vCPUs are online

Pavel Hrdina posted 1 patch 3 years, 1 month ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/85affd4b5cc1b96f5df95d552362f41f601a69be.1615813992.git.phrdina@redhat.com
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt PATCH] qemu_driver: fix setting vcpu_quota if not all vCPUs are online
Posted by Pavel Hrdina 3 years, 1 month ago
When switching to g_autoptr this was incorrectly changed from
'continue;' into 'return -1;' resulting into an error when user tries
to set vcpu_quota of running VM:

    error: An error occurred, but the cause is unknown

Fixes: e4a8bbfaf2b4cdd741bb441873bb730f9134b714
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b7c89a826a..16c5ccae45 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9204,7 +9204,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
         virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, i);
 
         if (!vcpu->online)
-            return -1;
+            continue;
 
         if (virCgroupNewThread(cgroup, VIR_CGROUP_THREAD_VCPU, i,
                                false, &cgroup_vcpu) < 0)
-- 
2.30.2

Re: [libvirt PATCH] qemu_driver: fix setting vcpu_quota if not all vCPUs are online
Posted by Erik Skultety 3 years, 1 month ago
On Mon, Mar 15, 2021 at 02:13:50PM +0100, Pavel Hrdina wrote:
> When switching to g_autoptr this was incorrectly changed from
> 'continue;' into 'return -1;' resulting into an error when user tries
> to set vcpu_quota of running VM:
> 
>     error: An error occurred, but the cause is unknown
> 
> Fixes: e4a8bbfaf2b4cdd741bb441873bb730f9134b714
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
Reviewed-by: Erik Skultety <eskultet@redhat.com>