From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43969 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlKyc-0004lU-KG for qemu-devel@nongnu.org; Fri, 04 Feb 2011 07:41:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlKyb-0006EZ-DC for qemu-devel@nongnu.org; Fri, 04 Feb 2011 07:41:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlKyb-0006EH-5C for qemu-devel@nongnu.org; Fri, 04 Feb 2011 07:41:25 -0500 Message-ID: <4D4BDAC8.8040400@redhat.com> Date: Fri, 04 Feb 2011 11:54:00 +0100 From: Jes Sorensen MIME-Version: 1.0 References: <1296636160-991-1-git-send-email-Jes.Sorensen@redhat.com> <1296636160-991-2-git-send-email-Jes.Sorensen@redhat.com> <4D4AEFD7.8060808@linux.vnet.ibm.com> In-Reply-To: <4D4AEFD7.8060808@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/2] Add virtagent file system freeze/thaw List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com, agl@us.ibm.com On 02/03/11 19:11, Michael Roth wrote: >> @@ -217,6 +221,186 @@ static xmlrpc_value *va_hello(xmlrpc_env *env, >> return result; >> } >> >> + >> +/* >> + * Walk the mount table and build a list of local file systems >> + */ >> + >> +struct direntry { >> + char *dirname; >> + char *devtype; >> + struct direntry *next; >> +}; >> + >> +static struct direntry *va_mount_list; >> +static int va_fsfreeze_status; > > And what I meant in the last RFC about using "objects" was to > encapsulate global state information for a particular group of commands > in single data type/variable. We're gonna end up with a similar set of > variables for stateful RPCs like copyfile and potentially a few for > things like spice. So to avoid having things get too cluttered up I'd > prefer something like, in this particular case: > > typedef struct VAFSFreezeState { > struct direntry *mount_list; > int status; > } VAFSFeezeState; > > static VAFSFreezeState va_fsfreeze_state; Ok, I got rid of the tabs (damn I thought I had caught them all), and added a struct to keep the freeze state. I didn't add any typedef grossness though. v3 coming up. Cheers, Jes