From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbpNf-0002cn-2i for qemu-devel@nongnu.org; Tue, 05 Jun 2012 04:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbpNY-0002iX-OB for qemu-devel@nongnu.org; Tue, 05 Jun 2012 04:44:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbpNY-0002iN-Gd for qemu-devel@nongnu.org; Tue, 05 Jun 2012 04:44:40 -0400 Message-ID: <4FCDC6F3.8030609@redhat.com> Date: Tue, 05 Jun 2012 10:44:35 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1338875386-21051-1-git-send-email-yhalperi@redhat.com> <1338875386-21051-3-git-send-email-yhalperi@redhat.com> In-Reply-To: <1338875386-21051-3-git-send-email-yhalperi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 2/5] migration: moving migration start code to a separated routine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yonit Halperin Cc: aliguori@us.ibm.com, alevy@redhat.com, qemu-devel@nongnu.org Hi, > -static MigrationState *migrate_init(int blk, int inc) > +static MigrationState *migrate_init(int protocol, const char *protocol_param, > + int blk, int inc) > + s->protocol = protocol; > + s->protocol_param = g_strdup(protocol_param); Hmm, I think I would store the complete uri here ... > if (strstart(uri, "tcp:", &p)) { > - ret = tcp_start_outgoing_migration(s, p, errp); > + migrate_protocol = MIGRATION_PROTOCOL_TCP; > #if !defined(WIN32) > } else if (strstart(uri, "exec:", &p)) { > - ret = exec_start_outgoing_migration(s, p); > + migrate_protocol = MIGRATION_PROTOCOL_EXEC; > } else if (strstart(uri, "unix:", &p)) { > - ret = unix_start_outgoing_migration(s, p); > + migrate_protocol = MIGRATION_PROTOCOL_UNIX; > } else if (strstart(uri, "fd:", &p)) { > - ret = fd_start_outgoing_migration(s, p); > + migrate_protocol = MIGRATION_PROTOCOL_FD; > #endif ... then just move that uri parsing code block to migrate_start(). cheers, Gerd