From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxeru-0006T0-8G for qemu-devel@nongnu.org; Wed, 15 Feb 2012 08:26:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rxero-0000si-DM for qemu-devel@nongnu.org; Wed, 15 Feb 2012 08:25:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxero-0000sb-3E for qemu-devel@nongnu.org; Wed, 15 Feb 2012 08:25:52 -0500 From: Juan Quintela In-Reply-To: <1328902266-25308-7-git-send-email-lcapitulino@redhat.com> (Luiz Capitulino's message of "Fri, 10 Feb 2012 17:31:06 -0200") References: <1328902266-25308-1-git-send-email-lcapitulino@redhat.com> <1328902266-25308-7-git-send-email-lcapitulino@redhat.com> Date: Wed, 15 Feb 2012 14:25:49 +0100 Message-ID: <87ipj8grdu.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 6/6] qapi: Convert migrate Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org Luiz Capitulino wrote: > The migrate command is one of those commands where HMP and QMP completely > mix up together. This made the conversion to the QAPI (which separates the > command into QMP and HMP parts) a bit difficult. > > The first important change to be noticed is that this commit completes the > removal of the Monitor object from migration code, started by the previous > commit. > > Another important and tricky change is about supporting the non-detached > mode. That's, if the user doesn't pass '-d' the migrate command will lock > the monitor and will only release it when migration is finished. > > To support that in the new HMP command (hmp_migrate()), it was necessary > to create a timer which runs every second and checks if the migration is > still active. If it's, the timer callback will re-schedule itself to run > one second in the future. If the migration has already finished, the > monitor lock is relased and the user can use it normally. > > All these changes should be transparent to the user. > +static void hmp_migrate_status_cb(void *opaque) > +{ > + MigrationStatus *status = opaque; > + MigrationInfo *info; > + > + info = qmp_query_migrate(NULL); > + if (!info->has_status || strcmp(info->status, "active") == 0) { > + qemu_mod_timer(status->timer, qemu_get_clock_ms(rt_clock) + > 1000); 1 second is one eternity. I will ask for something smaller (100ms or 200ms range). > + qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false, &err); This is the only user of qmp_migrate, why do we need to pass both has_blk & blk (and inc and !!inc?) Both parameters are bool, I am really confused here. Later, Juan.