]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virVMXParseConfig: Replace virStringSplitCount by g_strsplit
authorPeter Krempa <pkrempa@redhat.com>
Thu, 1 Apr 2021 13:36:49 +0000 (15:36 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 12 Apr 2021 13:55:10 +0000 (15:55 +0200)
Remove the last usage of virStringSplitCount

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/vmx/vmx.c

index ecc2db7f43d34ab77e63910ca7822373c5254244..89d08c1ce0438db474c58237a3aa76142a4a0df4 100644 (file)
@@ -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;
         }