[PATCH 37/39] virVMXParseConfig: Replace virStringSplitCount by g_strsplit

Peter Krempa posted 39 patches 4 years, 10 months ago
[PATCH 37/39] virVMXParseConfig: Replace virStringSplitCount by g_strsplit
Posted by Peter Krempa 4 years, 10 months ago
Remove the last usage of virStringSplitCount

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/vmx/vmx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 0b12b5dd7d..7832fd143e 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -1574,18 +1574,17 @@ virVMXParseConfig(virVMXContext *ctx,
     if (sched_cpu_affinity != NULL && STRCASENEQ(sched_cpu_affinity, "all")) {
         g_auto(GStrv) afflist = NULL;
         char **aff;
-        size_t naffs;

         def->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN);

-        if (!(afflist = virStringSplitCount(sched_cpu_affinity, ",", 0, &naffs)))
+        if (!(afflist = g_strsplit(sched_cpu_affinity, ",", 0)))
             goto cleanup;

-        if (naffs < numvcpus) {
+        if (g_strv_length(afflist) < numvcpus) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Expecting VMX entry 'sched.cpu.affinity' to contain "
                              "at least as many values as 'numvcpus' (%lld) but "
-                             "found only %zu value(s)"), numvcpus, naffs);
+                             "found only %u value(s)"), numvcpus, g_strv_length(afflist));
             goto cleanup;
         }

-- 
2.29.2

Re: [PATCH 37/39] virVMXParseConfig: Replace virStringSplitCount by g_strsplit
Posted by Ján Tomko 4 years, 10 months ago
On a Thursday in 2021, Peter Krempa wrote:
>Remove the last usage of virStringSplitCount
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/vmx/vmx.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>

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

Jano