From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQjTY-0002lB-Uo for qemu-devel@nongnu.org; Tue, 14 Jul 2009 10:59:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQjTU-0002kd-9E for qemu-devel@nongnu.org; Tue, 14 Jul 2009 10:59:24 -0400 Received: from [199.232.76.173] (port=48075 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQjTU-0002ka-41 for qemu-devel@nongnu.org; Tue, 14 Jul 2009 10:59:20 -0400 Received: from mail-px0-f201.google.com ([209.85.216.201]:60628) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQjTT-0000VI-LB for qemu-devel@nongnu.org; Tue, 14 Jul 2009 10:59:19 -0400 Received: by pxi39 with SMTP id 39so2161997pxi.4 for ; Tue, 14 Jul 2009 07:59:17 -0700 (PDT) Message-ID: <4A5C9D41.9040907@codemonkey.ws> Date: Tue, 14 Jul 2009 09:59:13 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] honor -S on incoming migration References: <1247579000-8535-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1247579000-8535-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini wrote: > -S is not honored by qemu on incoming migration. If a domain is migrated > while paused, thus, it will start running on the remote machine; this > is wrong. > > Given the trivial patch to fix this, it looks more like a thinko > than anything else, probably dating back to the qemu-kvm merge. > The interesting part is that the -S mechanism was in fact *used* when > migrating (setting autostart = 0) and the incoming migration code was > starting the VM at the end of the migration. > > Since I was removing the vm_start from there, I also corrected a related > imprecision. The code was doing a vm_stop "just in case", but we can > be sure that the VM is not running---the vm_start call in vl.c has not > been reached yet, and we rely on this now that the vm_start is removed > in migrate-*.c. So it's better to assert (!vm_running) instead. > Needs a Signed-off-by. > --- > migration-exec.c | 3 +-- > migration-tcp.c | 4 +--- > vl.c | 4 +--- > 3 files changed, 3 insertions(+), 8 deletions(-) > > diff --git a/migration-exec.c b/migration-exec.c > index 0dd5aff..5a111a0 100644 > --- a/migration-exec.c > +++ b/migration-exec.c > @@ -109,7 +109,7 @@ static void exec_accept_incoming_migration(void *opaque) > QEMUFile *f = opaque; > int ret; > > - vm_stop(0); /* just in case */ > + assert(!vm_running); /* just in case */ > I'd suggest removing the asserts but other than that, the patch looks good. Regards, Anthony Liguori