From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYGFT-00060E-Oc for qemu-devel@nongnu.org; Sun, 19 Jun 2011 07:33:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYGFS-0007bP-Th for qemu-devel@nongnu.org; Sun, 19 Jun 2011 07:33:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYGFS-0007bL-Mc for qemu-devel@nongnu.org; Sun, 19 Jun 2011 07:33:02 -0400 Message-ID: <4DFDDE67.6070901@redhat.com> Date: Sun, 19 Jun 2011 14:32:55 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1308319214-8474-1-git-send-email-joerg.roedel@amd.com> <1308319214-8474-2-git-send-email-joerg.roedel@amd.com> In-Reply-To: <1308319214-8474-2-git-send-email-joerg.roedel@amd.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-x86: Add tsc_khz option to -cpu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Joerg Roedel Cc: Anthony Liguori , Marcelo Tosatti , qemu-devel , kvm@vger.kernel.org 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