From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuM3o-0001eo-A8 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 07:16:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuM3i-0003mh-H5 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 07:16:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuM3i-0003mX-91 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 07:16:46 -0400 From: Juan Quintela In-Reply-To: <50112283.70201@siemens.com> (Jan Kiszka's message of "Thu, 26 Jul 2012 12:57:07 +0200") References: <1343155012-26316-1-git-send-email-quintela@redhat.com> <50112283.70201@siemens.com> Date: Thu, 26 Jul 2012 13:16:01 +0200 Message-ID: <874nou7oy6.fsf@trasno.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RFC 00/27] Migration thread (WIP) Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org Jan Kiszka wrote: > On 2012-07-24 20:36, Juan Quintela wrote: >> Hi >> Appart of the review: >> - Are there any locking issues that I have missed (I guess so) >> - stop all cpus correctly. vm_stop should be called from the iothread, >> I use the trick of using a bottom half to get that working correctly. >> but this _implementation_ is ugly as hell. Is there an easy way >> of doing it? > > vm_stop is prepared to be called from vcpu context as well. I'm not sure > right now if we actually do, but the code is there. But this is a migation_thread (i.e. neither iothread of vcpu), and we need to wait for vm_stop to finish. My reading is that in vcpu context, we just ask the iothread to stop all cpus. void vm_stop(RunState state) { if (!qemu_thread_is_self(&io_thread)) { qemu_system_vmstop_request(state); /* * FIXME: should not return to device code in case * vm_stop() has been requested. */ cpu_stop_current(); return; } do_vm_stop(state); } Or I am reading it wrong? Later, Juan.