From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Lalancette Subject: Re: [PATCH]: Add a "migrate_incoming" monitor option Date: Fri, 01 Aug 2008 11:09:42 +0200 Message-ID: <4892D2D6.8090703@redhat.com> References: <4891D14B.9010304@redhat.com> <20080731151149.GH18548@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm-devel To: "Daniel P. Berrange" Return-path: Received: from mx1.redhat.com ([66.187.233.31]:60481 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752174AbYHAJLT (ORCPT ); Fri, 1 Aug 2008 05:11:19 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m719BIiU022782 for ; Fri, 1 Aug 2008 05:11:18 -0400 In-Reply-To: <20080731151149.GH18548@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Daniel P. Berrange wrote: >> @@ -9673,11 +9675,16 @@ int main(int argc, char **argv) >> if (incoming) { >> int rc; >> >> - rc = migrate_incoming(incoming); >> - if (rc != 0) { >> - fprintf(stderr, "Migration failed rc=%d\n", rc); >> - exit(rc); >> - } >> + if (strncmp(incoming, "monitor", 7) == 0) { >> + incoming_monitor = 1; >> + } >> + else { >> + rc = migrate_incoming(incoming); >> + if (rc != 0) { >> + fprintf(stderr, "Migration failed rc=%d\n", rc); >> + exit(rc); >> + } >> + } > > Rather than putting the strncmp("monitor") into vl.c, I'd just leave > this part as is. Put the logic into the 'migrate_incoming()' method > so that it just sets the 'incoming_monitor' flag and then returns > immediately. That would allwo the 'incoming_Monitor' flag to be declared > static to the migrate.c file, instead of polluting vl.c Actually, that won't quite work. We still need to share the incoming_monitor flag between migration.c and monitor.c. However, your suggestion is better in that this is a "migration-specific" flag, so I'll move it over like you suggest. Chris Lalancette