From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] remove kvm_init_ap from qemu code. Date: Wed, 24 Sep 2008 12:37:05 +0300 Message-ID: <48DA0A41.7090507@redhat.com> References: <1222201515-8881-1-git-send-email-glommer@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, aliguori@us.ibm.com To: Glauber Costa Return-path: Received: from mx2.redhat.com ([66.187.237.31]:51661 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750988AbYIXJlp (ORCPT ); Wed, 24 Sep 2008 05:41:45 -0400 In-Reply-To: <1222201515-8881-1-git-send-email-glommer@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Glauber Costa wrote: > Call it as a special case for cpu 0 creation. This removes > a piece of kvm code from raw qemu. > > +void kvm_init_new_ap(int cpu, CPUState *env) > +{ > + if (!cpu) > + kvm_init_ap(); > + > + pthread_create(&vcpu_info[cpu].thread, NULL, ap_main_loop, env); > + > + while (vcpu_info[cpu].created == 0) > + qemu_cond_wait(&qemu_vcpu_cond); > +} > + > kvm_init_ap() is machine-level initialization. It's hacky to call it from cpu-level initialization. Do we have a machine-level initialization hook? [btw, !x makes sense when x is a boolean, pointer, or count. Then it means "there is no x" or "there are no xs". But when x is an index, !x means "x equals 0", so you may as well write that. and don't get me started on !strcmp()] -- error compiling committee.c: too many arguments to function