]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Swap position of nmodels and models parameters in cpuDecode()
authorJiri Denemark <jdenemar@redhat.com>
Thu, 11 Feb 2010 09:47:43 +0000 (10:47 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 11 Feb 2010 15:46:20 +0000 (16:46 +0100)
All other libvirt functions use array first and then number of elements
in that array. Let's make cpuDecode follow this rule.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/cpu/cpu.c
src/cpu/cpu.h
src/cpu/cpu_x86.c
src/qemu/qemu_conf.c

index ae8d37d0c37c1922d152f2accb70af8a8d7be801..e9ecc980cfce684b7e526dde2752a502ccc88e27 100644 (file)
@@ -119,8 +119,8 @@ cpuCompare(virCPUDefPtr host,
 int
 cpuDecode(virCPUDefPtr cpu,
           const union cpuData *data,
-          unsigned int nmodels,
-          const char **models)
+          const char **models,
+          unsigned int nmodels)
 {
     struct cpuArchDriver *driver;
 
@@ -146,7 +146,7 @@ cpuDecode(virCPUDefPtr cpu,
         return -1;
     }
 
-    return driver->decode(cpu, data, nmodels, models);
+    return driver->decode(cpu, data, models, nmodels);
 }
 
 
index 1e04993855b43182ec1473530a97ee2789b22ccd..7ee0ce6d7c33476e0940ae729e33e42434de6cd7 100644 (file)
@@ -48,8 +48,8 @@ typedef virCPUCompareResult
 typedef int
 (*cpuArchDecode)    (virCPUDefPtr cpu,
                      const union cpuData *data,
-                     unsigned int nmodels,
-                     const char **models);
+                     const char **models,
+                     unsigned int nmodels);
 
 typedef int
 (*cpuArchEncode)    (const virCPUDefPtr cpu,
@@ -95,8 +95,8 @@ cpuCompare  (virCPUDefPtr host,
 extern int
 cpuDecode   (virCPUDefPtr cpu,
              const union cpuData *data,
-             unsigned int nmodels,
-             const char **models);
+             const char **models,
+             unsigned int nmodels);
 
 extern int
 cpuEncode   (const char *arch,
index 7ae7fbf6f9e33b2c17e3978ca3be9c407aa9eabd..c6ed078b1c032ea2bc1392b6741d2db9ff6d94ad 100644 (file)
@@ -940,8 +940,8 @@ x86GuestData(virCPUDefPtr host,
 static int
 x86Decode(virCPUDefPtr cpu,
           const union cpuData *data,
-          unsigned int nmodels,
-          const char **models)
+          const char **models,
+          unsigned int nmodels)
 {
     int ret = -1;
     struct x86_map *map;
index 31a0c52112eae30671d52080f124e097e184c3aa..00f761d9e4a132936f53a682932cee5c0291c800 100644 (file)
@@ -1016,7 +1016,7 @@ qemudCapsInitCPU(virCapsPtr caps,
     cpu->threads = nodeinfo.threads;
 
     if (!(data = cpuNodeData(arch))
-        || cpuDecode(cpu, data, 0, NULL) < 0)
+        || cpuDecode(cpu, data, NULL, 0) < 0)
         goto error;
 
     caps->host.cpu = cpu;
@@ -2959,7 +2959,7 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
         if (VIR_ALLOC(guest) < 0 || !(guest->arch = strdup(ut->machine)))
             goto no_memory;
 
-        if (cpuDecode(guest, data, ncpus, cpus) < 0)
+        if (cpuDecode(guest, data, cpus, ncpus) < 0)
             goto cleanup;
 
         virBufferVSprintf(&buf, "%s", guest->model);