[PATCH 3/7] qemu_process: Fix return type of qemuDomainHasHotpluggableStartupVcpus()

Michal Privoznik via Devel posted 7 patches 3 months, 3 weeks ago
[PATCH 3/7] qemu_process: Fix return type of qemuDomainHasHotpluggableStartupVcpus()
Posted by Michal Privoznik via Devel 3 months, 3 weeks ago
From: Michal Privoznik <mprivozn@redhat.com>

The qemuDomainHasHotpluggableStartupVcpus() function is declared
to return an int but in fact its return type is a boolean. Even
its only caller (qemuProcessLaunch()) threads its retval as a
boolean. Switch the return type from integer to boolean.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1af91c5909..7fe49adfb4 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6405,7 +6405,7 @@ qemuProcessValidateHotpluggableVcpus(virDomainDef *def)
 }
 
 
-static int
+static bool
 qemuDomainHasHotpluggableStartupVcpus(virDomainDef *def)
 {
     size_t maxvcpus = virDomainDefGetVcpusMax(def);
-- 
2.49.0
Re: [PATCH 3/7] qemu_process: Fix return type of qemuDomainHasHotpluggableStartupVcpus()
Posted by Peter Krempa via Devel 3 months, 3 weeks ago
On Wed, May 14, 2025 at 16:24:12 +0200, Michal Privoznik via Devel wrote:
> From: Michal Privoznik <mprivozn@redhat.com>
> 
> The qemuDomainHasHotpluggableStartupVcpus() function is declared
> to return an int but in fact its return type is a boolean. Even
> its only caller (qemuProcessLaunch()) threads its retval as a

s/threads/treats/

> boolean. Switch the return type from integer to boolean.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/qemu/qemu_process.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 1af91c5909..7fe49adfb4 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -6405,7 +6405,7 @@ qemuProcessValidateHotpluggableVcpus(virDomainDef *def)
>  }
>  
>  
> -static int
> +static bool
>  qemuDomainHasHotpluggableStartupVcpus(virDomainDef *def)
>  {
>      size_t maxvcpus = virDomainDefGetVcpusMax(def);
> -- 
> 2.49.0
> 

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