From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaTUR-00045k-PE for qemu-devel@nongnu.org; Sat, 04 Oct 2014 13:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XaTUI-0001Z4-O5 for qemu-devel@nongnu.org; Sat, 04 Oct 2014 13:51:31 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:43404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaTUI-0001Z0-II for qemu-devel@nongnu.org; Sat, 04 Oct 2014 13:51:22 -0400 Received: by mail-wg0-f44.google.com with SMTP id y10so3672663wgg.27 for ; Sat, 04 Oct 2014 10:51:21 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <54303394.1050008@redhat.com> Date: Sat, 04 Oct 2014 19:51:16 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-47-git-send-email-dgilbert@redhat.com> In-Reply-To: <1412358473-31398-47-git-send-email-dgilbert@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 46/47] postcopy: Wire up loadvm_postcopy_ram_handle_{run, end} commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, lilei@linux.vnet.ibm.com, quintela@redhat.com, cristian.klein@cs.umu.se, amit.shah@redhat.com, yanghy@cn.fujitsu.com Il 03/10/2014 19:47, Dr. David Alan Gilbert (git) ha scritto: > + bool one_message = false; > + /* This looks good, but it's possible that the device loading in the > + * main thread hasn't finished yet, and so we might not be in 'RUN' > + * state yet. > + * TODO: Using an atomic_xchg or something for this This looks like a good match for QemuEvent. Or just mutex & condvar. > + */ > + while (mis->postcopy_ram_state == POSTCOPY_RAM_INCOMING_LISTENING) { What if we had postcopy of something else than RAM? Can you remove the "ram" part from the symbols that do not directly deal with RAM but just with the protocol? Paolo > + if (!one_message) { > + DPRINTF("%s: Waiting for RUN", __func__); > + one_message = true; > + } > + } > + }