qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] qemu-x86: Add tsc_khz option to -cpu


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-x86: Add tsc_khz option to -cpu
Date: Sun, 19 Jun 2011 14:32:55 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10

On 06/17/2011 05:00 PM, Joerg Roedel wrote:
To let the user configure the desired tsc frequency for the
guest if running in KVM.

@@ -704,6 +705,14 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, 
const char *cpu_model)
              } else if (!strcmp(featurestr, "model_id")) {
                  pstrcpy(x86_cpu_def->model_id, sizeof(x86_cpu_def->model_id),
                          val);
+            } else if (!strcmp(featurestr, "tsc_khz")) {
+                char *err;
+                numvalue = strtoul(val,&err, 0);
+                if (!*val || *err) {
+                    fprintf(stderr, "bad numerical value %s\n", val);
+                    goto error;
+                }
+                x86_cpu_def->tsc_khz = numvalue;
              } else {
                  fprintf(stderr, "unrecognized feature %s\n", featurestr);
                  goto error;

Frequency should be in Hz, not kHz. We can use [kMG] suffixes for simpler specification (but 1GHz = 10^9 Hz, not the binary thing).

--
error compiling committee.c: too many arguments to function




reply via email to

[Prev in Thread] Current Thread [Next in Thread]